Combo Boxes

Combo boxes are a cross between a text field and a pop-up button. A combo box contains an editable text field cell and a button to the right of the text field cell. The button cell has a down pointing arrow, similar to a pull-down list. Clicking the button opens a list of items from which the user can choose a value. Combo boxes also support autocompletion as an option.

Cocoa uses the NSComboBox and NSComboBoxCell classes to implement combo boxes. These classes inherit from NSTextField and NSTextFieldCell, respectively. All the text field manipulations described in Chapter 10 apply to the text field portion of the combo box.

Because a combo box has a pull-down list from which a user can choose, it acts much like a pop-up button, ...

Get Cocoa® Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.