Discussion:
NSComboBox
(too old to reply)
Casey McDermott
2018-07-25 17:45:44 UTC
Permalink
Apple's instructions for combo boxes say: "Note that while you can construct your NSComboBox
so that users are restricted to only selecting items from the combo box’s pop-up list,
this isn’t the combo box’s normal behavior."

For our use, we definitely want to restrict NSComboBox to only accept items in the list.
For accounting, we can't create new accounts on the fly from just a name, especially if users make a typo.
The goal is to auto-fill an account from what they type, and ignore typing if not a match.

We searched sample projects, the archives here, and StackOverflow. No instructions on how to
restrict it. Has anyone here ever done it?

BTW our current Carbon app does something similar with a text field and popup. The design
came from from an article in Dev Connect by Bruce Tognazzini back in the late 80s.
He called it a "disambiguating field".

I'm surprised NSComboBox doesn't just have a Boolean to do what we want.

Thanks,

Casey McDermott

Turtle Creek Software
http://www.turtlesoft.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.
John Harte
2018-07-25 18:41:44 UTC
Permalink
Post by Casey McDermott
Apple's instructions for combo boxes say: "Note that while you can construct your NSComboBox
so that users are restricted to only selecting items from the combo box’s pop-up list,
this isn’t the combo box’s normal behavior."
For our use, we definitely want to restrict NSComboBox to only accept items in the list.
For accounting, we can't create new accounts on the fly from just a name, especially if users make a typo.
The goal is to auto-fill an account from what they type, and ignore typing if not a match.
We searched sample projects, the archives here, and StackOverflow. No instructions on how to
restrict it. Has anyone here ever done it?
I switched Behavior for Text Field in the Attributes Inspector from Editable to Selectable and it works, I can select from the list but I can’t type in text.

Hope that helps,
John
Jens Alfke
2018-07-25 18:51:45 UTC
Permalink
Post by Casey McDermott
The goal is to auto-fill an account from what they type, and ignore typing if not a match.
That sounds like the regular behavior of NSPopUpButton: after clicking to pop up the menu, you can type-select items from it.

(Although it doesn't ignore mismatches, it just selects the closest item.)

—Jens
_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.narkive.net
Rob Petrovec
2018-07-25 18:54:04 UTC
Permalink
I was going to suggest the same thing. NSPopUpButton should do what you want.

—Rob
Post by Jens Alfke
Post by Casey McDermott
The goal is to auto-fill an account from what they type, and ignore typing if not a match.
That sounds like the regular behavior of NSPopUpButton: after clicking to pop up the menu, you can type-select items from it.
(Although it doesn't ignore mismatches, it just selects the closest item.)
—Jens
_______________________________________________
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
https://lists.apple.com/mailman/options/cocoa-dev/petrock%40mac.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.narkive.net

This email sent to ***@ml-in.narkive.ne
Casey McDermott
2018-07-25 22:40:48 UTC
Permalink
I forgot to mention that the lists may contain 10,000s of items. Maybe 100,000s. 
Typing to select from NSPopUpButton works OK for short lists. I just made a test
popup with 300 items and it's already awkward. 10K would be absurd.

These are business records, and users may data enter hundreds a day. They want
to tab, type a few letters to select a customer, tab to the next field, type a bit to
select an inventory item, etc. Type a customer that doesn't exist and it should beep
and ignore the keystrokes. If they need to enter a new customer, it's a right-click,
then a panel to enter more than just the name.

Our current interface does use popup buttons for some things, but people complain
about them. They don't want to take hands off keyboard. We plan to convert those
to combo boxes so it can be completely mouseless.

That "disambiguating field" article by Tog may be on one of the developer CDs.
I can't find it online. It explained this use case very well, and interface to solve it.
It was a major reason why we switched from Excel templates to a C++ app.
NSComboBox is close, but we need it confined to existing items.

Thanks,

Casey McDermott

Turtle Creek Software
http://www.turtlesoft.com
607 220-4514

--------------------------------------------
On Wed, 7/25/18, Jens Alfke <***@mooseyard.com> wrote:

Subject: Re: NSComboBox
To: "Casey McDermott" <***@turtlesoft.com>
Cc: cocoa-***@lists.apple.com
Date: Wednesday, July 25, 2018, 2:51 PM



On
Jul 25, 2018, at 10:45 AM, Casey McDermott <***@turtlesoft.com>
wrote:
The
goal is to auto-fill an account from what they type, and
ignore typing if not a match.

That sounds like the regular behavior
of NSPopUpButton: after clicking to pop up the menu, you can
type-select items from it. 
(Although it doesn't ignore
mismatches, it just selects the closest item.)
—Jens
_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.narkive.net

This email sent to ***@ml-in.narkive.ne
Sandor Szatmari
2018-07-25 23:40:40 UTC
Permalink
I have done stuff like this just using NSTextField. You can connect delegate methods to supply the array of suitable strings to select from that match the ‘prefix’ the user types in. For every character the user types I recalculate the array of completions. You can filter a very long list of completions very quickly. I don’t have the code in front of me but I can post something tomorrow if this sounds like an avenue you haven’t considered yet.

I think it was a combination of:

-controlTextDidChange:

-(NSArray *)control:(NSControl *)control textView:(NSTextView *)textView completions:(NSArray *)words forPartialWordRange:(NSRange)charRange indexOfSelectedItem:(NSInteger *)index

I found that the non obvious part was setting the pointer ‘index’ to -1 or something like that to indicate that no selection was made yet. This caused the entire list of possible completions to be presented. Then everything worked as expected. If you know the index of the string you want to autocomplete to you set ‘index’ to that, well…, index.

Sandor
HTH,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
Post by Casey McDermott
I forgot to mention that the lists may contain 10,000s of items. Maybe 100,000s.
Typing to select from NSPopUpButton works OK for short lists. I just made a test
popup with 300 items and it's already awkward. 10K would be absurd.
These are business records, and users may data enter hundreds a day. They want
to tab, type a few letters to select a customer, tab to the next field, type a bit to
select an inventory item, etc. Type a customer that doesn't exist and it should beep
and ignore the keystrokes. If they need to enter a new customer, it's a right-click,
then a panel to enter more than just the name.
Our current interface does use popup buttons for some things, but people complain
about them. They don't want to take hands off keyboard. We plan to convert those
to combo boxes so it can be completely mouseless.
That "disambiguating field" article by Tog may be on one of the developer CDs.
I can't find it online. It explained this use case very well, and interface to solve it.
It was a major reason why we switched from Excel templates to a C++ app.
NSComboBox is close, but we need it confined to existing items.
Thanks,
Casey McDermott
Turtle Creek Software
http://www.turtlesoft.com
607 220-4514
--------------------------------------------
Subject: Re: NSComboBox
Date: Wednesday, July 25, 2018, 2:51 PM
On
The
goal is to auto-fill an account from what they type, and
ignore typing if not a match.
That sounds like the regular behavior
of NSPopUpButton: after clicking to pop up the menu, you can
type-select items from it.
(Although it doesn't ignore
mismatches, it just selects the closest item.)
—Jens
_______________________________________________
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
_______________________________________________
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
https://lists.apple.com/mailman/options/cocoa-dev/admin.szatmari.net%40gmail.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.narkive.net

This email
Quincey Morris
2018-07-25 23:55:17 UTC
Permalink
Post by Casey McDermott
I forgot to mention that the lists may contain 10,000s of items. Maybe 100,000s.
Typing to select from NSPopUpButton works OK for short lists. I just made a test
popup with 300 items and it's already awkward. 10K would be absurd.
These are business records, and users may data enter hundreds a day. They want
to tab, type a few letters to select a customer, tab to the next field, type a bit to
select an inventory item, etc. Type a customer that doesn't exist and it should beep
and ignore the keystrokes. If they need to enter a new customer, it's a right-click,
then a panel to enter more than just the name.
Our current interface does use popup buttons for some things, but people complain
about them. They don't want to take hands off keyboard. We plan to convert those
to combo boxes so it can be completely mouseless.
If that’s your use case, there’s something else gong on at the heart of this.

What value — if there are tens of thousands of items — is there in popping anything up at all, whether it’s a combo-box-style popup or a menu-style popup? It seems that you should just validate the text field every stroke, and provide the rest of the field as soon as what is typed becomes unique. Or does the user need to scan the list of near-matches for some reason?

Another approach to this might be to be something like autocomplete, but where you don’t start offering autocompletions until enough text has been entered to limit the possibilities to a manageable number of choices. Text fields have built-in support for autocomplete, although IIRC it gets a bit harder if the completions are context sensitive — if typing more characters changes the list of possibilities, rather than just limiting it. (Xcode’s autocompletions are content sensitive in this sense, but Xcode has its own implementation unrelated to NSTextField’s.)

Or, use a table view next to the text field, and programmatically scroll to the area of the list that matches what the user has typed so far. NSTableView is essentially optimized for displaying small fragments of huge lists, so it might be better than trying to stuff all those entries in a combo box.


_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-i
Casey McDermott
2018-07-26 00:18:09 UTC
Permalink
We have a 1/2 decent version working right now based on NSTextField. It shows a scrolling table
with a NSWindowController, and selects from the table (and beeps if not there). It also
has a NSPopUpButton on the side to use as an additional option (handy for short lists
or if the user is already mousing). Basically, that is the same approach we use/used in the
C++ version (PowerPlant, Carbon).

But, getting all the details to work just right has been extremely difficult. NSComboBox
is sooooo close, and so much less futzing. Also, the combo box in Windows MFC
does exactly what we need, and it would be nice if both platforms looked the same.

One big beef I have is that it's not possible to step into Cocoa source, unlike PowerPlant
or MFC. It makes it much harder to understand what's going on inside Cocoa.

Thanks,

Casey McDermott

Turtle Creek Software
http://www.turtlesoft.com
607 220-4514

--------------------------------------------
On Wed, 7/25/18, Sandor Szatmari <***@gmail.com> wrote:

Subject: Re: NSComboBox
To: "Keary Suska" <cocoa-***@esoteritech.com>
Cc: "Casey McDermott" <***@turtlesoft.com>, "Cocoa-Dev (Apple)" <cocoa-***@lists.apple.com>
Date: Wednesday, July 25, 2018, 7:40 PM

I have done stuff like this just
using NSTextField.  You can connect delegate methods to
supply the array of suitable strings to select from that
match the ‘prefix’ the user types in.  For every
character the user types I recalculate the array of
completions.  You can filter a very long list of
completions very quickly.  I don’t have the code in front
of me but I can post something tomorrow if this sounds like
an avenue you haven’t considered yet.

I think it was a combination of:

-controlTextDidChange:

-(NSArray *)control:(NSControl
*)control textView:(NSTextView *)textView
completions:(NSArray *)words
forPartialWordRange:(NSRange)charRange
indexOfSelectedItem:(NSInteger *)index

I found that the non obvious part was setting
the pointer ‘index’ to -1 or something like that to
indicate that no selection was made yet.  This caused the
entire list of possible completions to be presented. Then
everything worked as expected.  If you know the index of
the string you want to autocomplete to you set ‘index’
to that, well…, index.

Sandor
Post by Casey McDermott
On
NSComboBox
is just a suped-up NSTextField, so you can some sort of
validation so you can prevent the user from exiting the
field if they don’t enter an acceptable value. The most
basic approach is delegation and doing the check in 
Post by Casey McDermott
HTH,
Keary Suska
Esoteritech, Inc.
Post by Casey McDermott
"Demystifying
technology for your home or business"
Post by Casey McDermott
On Jul 25, 2018,
I
forgot to mention that the lists may contain 10,000s of
items. Maybe 100,000s.
Post by Casey McDermott
Typing to
select from NSPopUpButton works OK for short lists.  I just
made a test
Post by Casey McDermott
popup with 300 items
and it's already awkward.  10K would be absurd.
Post by Casey McDermott
These are
business records, and users may data enter hundreds a day. 
They want
Post by Casey McDermott
to tab, type a few
letters to select a customer, tab to the next field, type a
bit to
Post by Casey McDermott
select an inventory item,
etc.  Type a customer that doesn't exist and it should
beep
Post by Casey McDermott
and ignore the keystrokes. 
If they need to enter a new customer, it's a
right-click,
Post by Casey McDermott
then a panel to enter
more than just the name.
Post by Casey McDermott
Our current interface does use popup
buttons for some things, but people complain
Post by Casey McDermott
about them.  They don't want to
take hands off keyboard.  We plan to convert those
Post by Casey McDermott
to combo boxes so it can be completely
mouseless.
Post by Casey McDermott
That "disambiguating field"
article by Tog may be on one of the developer CDs. 
Post by Casey McDermott
I can't find it online. It
explained this use case very well, and interface to solve
it.
Post by Casey McDermott
It was a major reason why we
switched from Excel templates to a C++ app.
Post by Casey McDermott
NSComboBox is close, but we need it
confined to existing items.
Post by Casey McDermott
Thanks,
Casey McDermott
Turtle Creek
Software
Post by Casey McDermott
http://www.turtlesoft.com
607 220-4514
--------------------------------------------
wrote:
Subject: Re: NSComboBox
Post by Casey McDermott
Date: Wednesday, July 25, 2018, 2:51
PM
Post by Casey McDermott
On
Jul 25, 2018, at 10:45 AM, Casey
The
goal is to auto-fill an account from
what they type, and
Post by Casey McDermott
ignore typing
if not a match.
Post by Casey McDermott
That sounds like the regular
behavior
Post by Casey McDermott
of NSPopUpButton: after
clicking to pop up the menu, you can
Post by Casey McDermott
type-select items from it.
(Although it doesn't ignore
mismatches, it just selects the
closest item.)
Post by Casey McDermott
—Jens
_______________________________________________
Post by Casey McDermott
Cocoa-dev
Please do
not post admin requests or moderator comments to the
list.
Post by Casey McDermott
Contact the moderators at
cocoa-dev-admins(at)lists.apple.com
Post by Casey McDermott
Help/Unsubscribe/Update your
https://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
This email
sent to cocoa-***@esoteritech.com
_______________________________________________
Post by Casey McDermott
Cocoa-dev mailing
Please do not post
admin requests or moderator comments to the list.
Post by Casey McDermott
Contact the moderators at
cocoa-dev-admins(at)lists.apple.com
Post by Casey McDermott
Help/Unsubscribe/Update your
https://lists.apple.com/mailman/options/cocoa-dev/admin.szatmari.net%40gmail.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.narkive.net

This
Richard Charles
2018-07-26 01:51:28 UTC
Permalink
Post by Casey McDermott
One big beef I have is that it's not possible to step into Cocoa source, unlike PowerPlant
or MFC. It makes it much harder to understand what's going on inside Cocoa.
Check out the Cocotron source. Sometimes you can gain insight into what going on by looking there.

--Richard Charles

_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.narkive.net

This email sent to ***@ml-in.narkive.net
Alastair Houghton
2018-07-26 08:45:42 UTC
Permalink
Post by Casey McDermott
We have a 1/2 decent version working right now based on NSTextField. It shows a scrolling table
with a NSWindowController, and selects from the table (and beeps if not there). It also
has a NSPopUpButton on the side to use as an additional option (handy for short lists
or if the user is already mousing). Basically, that is the same approach we use/used in the
C++ version (PowerPlant, Carbon).
But, getting all the details to work just right has been extremely difficult. NSComboBox
is sooooo close, and so much less futzing. Also, the combo box in Windows MFC
does exactly what we need, and it would be nice if both platforms looked the same.
One big beef I have is that it's not possible to step into Cocoa source, unlike PowerPlant
or MFC. It makes it much harder to understand what's going on inside Cocoa.
To be fair, in the case of MFC some of it (like the combobox) relies on underlying Windows controls that you also don’t have the source for.

NSComboBox is pretty unusual in a Mac application; you don’t see many of them about, and I think that’s because there are often better options (particularly in cases like yours where you say there may be thousands of possible choices), not to mention the fact that historically the NSComboBox looked rather ugly compared to other Aqua controls. You might also consider using something like NSTokenField (check out the To and Cc fields in Apple Mail for an idea of what that might look like).

Someone suggested looking at the Cocotron source; that isn’t a bad idea — though Cocotron’s implementations are sometimes rather simpler than the ones in the Cocoa framework — and you could also look at GNUStep’s sources to see how it does things. Neither, of course, guarantees that Apple/NeXT chose the same approach, although in many cases the API itself does dictate some of the details of how it works under the covers; if you want to know how it really works, grab yourself a copy of Hopper <https://www.hopperapp.com <https://www.hopperapp.com/>> (or IDA, or even just do it the old fashioned way using otool) and disassemble the relevant framework.

Kind regards,

Alastair.

--
http://alastairs-place.net

_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.narkive.net

This email sent to ***@ml-in.narkive.
Casey McDermott
2018-07-26 00:50:07 UTC
Permalink
Post by Casey McDermott
Post by Quincey Morris
Or does the user need to scan the list of near-matches for some reason?
Yes, exactly. When you have 20K customer records, you don't remember how
each was entered, or how spelled. You may need to type a letter or 2 and then
scroll the list. It may take a few tries: Smith Company? Smyth Company?
The Smith Company? Josephine Smith & Co?

Our customer database has dozens of duplicate names, so they might be entered as
Smith Company NY and Smith Company CA.

Sometimes one has no idea what's in the list, so it really helps to be able to scroll.
A popup is probably better for that, but not when in hands-on-keyboard mode.

NSComboBox is so close. That one sentence in the docs is so tantalizing!

Thanks,

Casey McDermott

Turtle Creek Software
http://www.turtlesoft.com
607 220-4514

--------------------------------------------
On Wed, 7/25/18, Quincey Morris <***@rivergatesoftware.com> wrote:

Subject: Re: NSComboBox
To: "Casey McDermott" <***@turtlesoft.com>
Cc: "Cocoa-Dev List" <cocoa-***@lists.apple.com>
Date: Wednesday, July 25, 2018, 7:55 PM

On Jul 25, 2018, at 15:40 , Casey
Post by Casey McDermott
I forgot to mention
that the lists may contain 10,000s of items. Maybe 100,000s.
Post by Casey McDermott
Typing to select from NSPopUpButton
works OK for short lists.  I just made a test
Post by Casey McDermott
popup with 300 items and it's already
awkward.  10K would be absurd.
Post by Casey McDermott
These are business records, and users may
data enter hundreds a day.  They want
to tab, type a few letters to select a customer, tab to the
next field, type a bit to
Post by Casey McDermott
select an
inventory item, etc.  Type a customer that doesn't
exist and it should beep
Post by Casey McDermott
and ignore
the keystrokes.  If they need to enter a new customer,
it's a right-click,
Post by Casey McDermott
then a panel
to enter more than just the name.
Post by Casey McDermott
Our current interface does use popup
buttons for some things, but people complain
Post by Casey McDermott
about them.  They don't want to take
hands off keyboard.  We plan to convert those
Post by Casey McDermott
to combo boxes so it can be completely
mouseless.

If
that’s your use case, there’s something else gong on at
the heart of this.

What
value — if there are tens of thousands of items — is
there in popping anything up at all, whether it’s a
combo-box-style popup or a menu-style popup? It seems that
you should just validate the text field every stroke, and
provide the rest of the field as soon as what is typed
becomes unique. Or does the user need to scan the list of
near-matches for some reason?

Another approach to this might be to be
something like autocomplete, but where you don’t start
offering autocompletions until enough text has been entered
to limit the possibilities to a manageable number of
choices. Text fields have built-in support for autocomplete,
although IIRC it gets a bit harder if the completions are
context sensitive — if typing more characters changes the
list of possibilities, rather than just limiting it.
(Xcode’s autocompletions are content sensitive in this
sense, but Xcode has its own implementation unrelated to
NSTextField’s.)

Or, use a
table view next to the text field, and programmatically
scroll to the area of the list that matches what the user
has typed so far. NSTableView is essentially optimized for
displaying small fragments of huge lists, so it might be
better than trying to stuff all those entries in a combo
box.


_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.narkive.net

This email sent to geg
Clark Cox
2018-07-27 17:23:17 UTC
Permalink
In UIs like this that I have made in the past I use a popover or a custom pop-up. I.e. something like:

+----------------+
| Field |
+--------+-------+
^
+-------------------+-------------------+
| Filter Field |
+---------------------------------------+
| |
| Item 1 |
| Item 2 |
| Item 3 |
| ... |
| Item n |
| |
+---------------------------------------+

- The user tabs-into (or clicks) the field, and a popover is displayed, and the filter field is made first responder.
- As the user types (into the now active filter field), the table below it is filtered down to matching items
- The user can then either click on the appropriate option, or if there is only one, just hit enter

You can see a similar UI if, in Xcode, you click the navigation pop up at the top of a source file and start typing.
Post by Casey McDermott
Post by Casey McDermott
Post by Quincey Morris
Or does the user need to scan the list of near-matches for some reason?
Yes, exactly. When you have 20K customer records, you don't remember how
each was entered, or how spelled. You may need to type a letter or 2 and then
scroll the list. It may take a few tries: Smith Company? Smyth Company?
The Smith Company? Josephine Smith & Co?
Our customer database has dozens of duplicate names, so they might be entered as
Smith Company NY and Smith Company CA.
Sometimes one has no idea what's in the list, so it really helps to be able to scroll.
A popup is probably better for that, but not when in hands-on-keyboard mode.
NSComboBox is so close. That one sentence in the docs is so tantalizing!
Thanks,
Casey McDermott
Turtle Creek Software
http://www.turtlesoft.com
607 220-4514
--------------------------------------------
Subject: Re: NSComboBox
Date: Wednesday, July 25, 2018, 7:55 PM
On Jul 25, 2018, at 15:40 , Casey
Post by Casey McDermott
I forgot to mention
that the lists may contain 10,000s of items. Maybe 100,000s.
Post by Casey McDermott
Typing to select from NSPopUpButton
works OK for short lists. I just made a test
Post by Casey McDermott
popup with 300 items and it's already
awkward. 10K would be absurd.
Post by Casey McDermott
These are business records, and users may
data enter hundreds a day. They want
to tab, type a few letters to select a customer, tab to the
next field, type a bit to
Post by Casey McDermott
select an
inventory item, etc. Type a customer that doesn't
exist and it should beep
Post by Casey McDermott
and ignore
the keystrokes. If they need to enter a new customer,
it's a right-click,
Post by Casey McDermott
then a panel
to enter more than just the name.
Post by Casey McDermott
Our current interface does use popup
buttons for some things, but people complain
Post by Casey McDermott
about them. They don't want to take
hands off keyboard. We plan to convert those
Post by Casey McDermott
to combo boxes so it can be completely
mouseless.
If
that’s your use case, there’s something else gong on at
the heart of this.
What
value — if there are tens of thousands of items — is
there in popping anything up at all, whether it’s a
combo-box-style popup or a menu-style popup? It seems that
you should just validate the text field every stroke, and
provide the rest of the field as soon as what is typed
becomes unique. Or does the user need to scan the list of
near-matches for some reason?
Another approach to this might be to be
something like autocomplete, but where you don’t start
offering autocompletions until enough text has been entered
to limit the possibilities to a manageable number of
choices. Text fields have built-in support for autocomplete,
although IIRC it gets a bit harder if the completions are
context sensitive — if typing more characters changes the
list of possibilities, rather than just limiting it.
(Xcode’s autocompletions are content sensitive in this
sense, but Xcode has its own implementation unrelated to
NSTextField’s.)
Or, use a
table view next to the text field, and programmatically
scroll to the area of the list that matches what the user
has typed so far. NSTableView is essentially optimized for
displaying small fragments of huge lists, so it might be
better than trying to stuff all those entries in a combo
box.
_______________________________________________
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
https://lists.apple.com/mailman/options/cocoa-dev/clarkcox3%40gmail.com
--
Clark Smith Cox III
***@gmail.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.narkive.net

This email sent to gegs
Uli Kusterer
2018-07-29 05:48:53 UTC
Permalink
Post by Casey McDermott
Sometimes one has no idea what's in the list, so it really helps to be able to scroll.
A popup is probably better for that, but not when in hands-on-keyboard mode.
You're aware that popups support type-selection, arrow keys etc.? In fact, all menus on OS X have supported that for quite a while now.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de

_______________________________________________

Cocoa-dev mailing list (Cocoa-***@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/gegs%40ml-in.narkive.net

This email sent to ***@ml-in.narkive.net

Continue reading on narkive:
Loading...