Re: Dynamically populate a popup menu
Re: Dynamically populate a popup menu
- Subject: Re: Dynamically populate a popup menu
- From: Graham Cox <email@hidden>
- Date: Thu, 18 Feb 2010 11:02:41 +1100
On 18/02/2010, at 3:00 AM, Steven Degutis wrote:
> While NSMenuDelegate isn't wrong per se, I still prefer to use the
> NSPopUpButton's notification myself. Touching the button's internal menu
> seems like dipping my fingers where they don't belong.
NSMenuDelegate works fine with pop-up buttons. If the button's menu has dynamic content, how are you going to achieve it without 'dipping your fingers' into its menu? That's why it has a public -menu method, which you'd have to use from your notification handler anyway. The delegate approach is more direct and the supported way to do this.
--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