2
votes

Multiselect NSComboBox

Can we have a NSComboBox with multiple selection through checkboxes in OSx. Please find the attached image as an example.

Please help.

1
Please add some clarification. Do you want to change the menu of the combo box according to the selection of a radio buttons? - Daniel Farrell
@boyfarrell Thanks for replying, i have edited my question, does that helped to clarify my requirement? - Utkarsha
I recommend using an NSPopUpButton configured in pull-down mode and, as the user picks item, you adjust its title to reflect what's selected. - Ken Thomases
@KenThomases But how will you show multiple selection in NSPopUpButton? - Utkarsha
You can set the state of the menu items so they show a check mark. - Ken Thomases

1 Answers

2
votes

According to the NSComboBox class reference - the answer is NO.

as you can see on the Manipulating the Selection:

@property(readonly) NSInteger indexOfSelectedItem
@property(readonly, strong) id objectValueOfSelectedItem

- deselectItemAtIndex: 
- selectItemAtIndex:
- selectItemWithObjectValue:

they refer to the selected item as single selection.

so I'd suggest looking for a custom solution, like keeping the selections on a different array and binding it together.