Restricting NSComboBox to specific values
Restricting NSComboBox to specific values
- Subject: Restricting NSComboBox to specific values
- From: Chris Hanson <email@hidden>
- Date: Mon, 10 Mar 2003 13:39:13 -0600
I'm working on an application that uses NSComboBoxes in its human
interface so it can be driven entirely from the keyboard.
I'd like to be able to restrict these NSComboBoxes to only allow
entry of certain values, while still allowing the user to start
typing the values in.
I'd also like to make the combo boxes case-insensitive.
Anyone have any suggestions as to how to go about this? It seems
like I'll have to create a combo box data source that responds to
-comboBox:completedString: and
-comboBoxCell:indexOfItemWithStringValue: in addition to the required
methods. The contents of these combo boxes are static, though, so
I'd actually prefer to just use the internal list and avoid anything
involving a data source.
(I suppose I could subclass NSComboBox & NSComboBoxCell, and
implement the data source methods in my subclass to use the internal
list. Would that be reasonable?)
-- Chris
--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Application Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.