NSPopUpButton pullsDown:YES and dummy first item - normal?
NSPopUpButton pullsDown:YES and dummy first item - normal?
- Subject: NSPopUpButton pullsDown:YES and dummy first item - normal?
- From: Rua Haszard Morris <email@hidden>
- Date: Thu, 2 Apr 2009 14:55:29 +1300
I am using a pull-down NSPopUpButton for a little button which
displays a little menu. The menu has some commands in it, i.e. it's
not a selection menu, the title of the button just displays an icon,
no title, no indication of a current item from the menu. I am calling
(ahem, sending) setUsesItemFromMenu:NO on (to) the cell.
It appears that with pull-down menus I need to insert a dummy item at
index zero as my NSPopUpButton as a placeholder, and that
NSPopUpButton/Cell (when in pull-down mode) will handily ignore this
item.
This seems like a weird hack, and makes me think I'm going about this
the wrong way - is this a normal approach?
The documentation mentions that the index of the first item in a pull-
down should be 1, but it doesn't explain that you need to add a dummy
item (for the zeroth) or else your first item will go missing.
thanks
Rua HM.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden