|
|
#1 |
|
NSPopupButton selected item
In my OS X Cocoa app, I'm using an NSPopupButton to present the user with a list of choices. When an item is selected, it isn't marked.
Code:
[baudButton removeAllItems]; [baudButton addItemWithTitle:(@"Baud")]; [baudButton addItemWithTitle:(@"600")]; [baudButton addItemWithTitle:(@"1200")]; |
|
|
|
0
|
|
|
#2 |
|
I am going to guess you are talking about a checkmark - for that, you can set the state of the NSMenuItem.
__________________
MacBook Pro / OS X Mountain Lion (10.8.3) / Xcode 4.6 / [various (much) older stuff keeping dust off the shelves] |
|
|
|
0
|
|
|
#3 |
|
You could try to jump start the process.
Code:
[baudButton selectItemAtIndex:1] Code:
[baudButton indexOfSelectedItem] |
|
|
|
0
|
|
|
#4 | |
|
Quote:
. But I'm a newbie to Cocoa.
|
||
|
|
0
|
|
|
#5 | |
|
Quote:
. I have no problem getting the selected menu item. I want to mark it as selected (check mark, change color, highlight the item).The connection is to the whole button. |
||
|
|
0
|
|
|
#6 | |
|
Quote:
__________________
MacBook Pro / OS X Mountain Lion (10.8.3) / Xcode 4.6 / [various (much) older stuff keeping dust off the shelves] |
||
|
|
1
|
|
|
#7 | |
|
Quote:
There are multiple items. Actually, setting the NSButton's type to popup accomplished my goal. |
||
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 05:59 PM.







. But I'm a newbie to Cocoa.
. I have no problem getting the selected menu item. I want to mark it as selected (check mark, change color, highlight the item).
Linear Mode
