Re: NSPopUpButton pullsDown:YES and dummy first item - normal?
Re: NSPopUpButton pullsDown:YES and dummy first item - normal?
- Subject: Re: NSPopUpButton pullsDown:YES and dummy first item - normal?
- From: Graham Cox <email@hidden>
- Date: Thu, 2 Apr 2009 22:58:10 +1100
On 02/04/2009, at 12:55 PM, Rua Haszard Morris wrote:
This seems like a weird hack, and makes me think I'm going about
this the wrong way - is this a normal approach?
I'm afraid so. I think the reason could be (pre)historic - the
original Carbon Menu Manager (which Cocoa sits atop) constructed menus
this way. It sucks, has always sucked, and looks likely that (as it
has never been changed despite the vast catalogue of other changes
elsewhere) will always suck.
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.
Well, since it's just a list that starts at 0, how else can your first
item have an index of 1 except that a dummy item be inserted?
Also, with pull-down menus, watch out for the IB bug that sets all
items to hidden whenever you insert a new one.
--Graham
_______________________________________________
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