Re: PopupButton help
Re: PopupButton help
- Subject: Re: PopupButton help
- From: Stephane Sudre <email@hidden>
- Date: Tue, 9 Dec 2003 18:06:09 +0100
On Tuesday, December 9, 2003, at 05:42 PM, Kurt Marek wrote:
I'm just getting started trying to implement an NSPopupButton and I'm
having trouble figuring out the easiest way to populate the NSMenu
that goes along with it. The popupButton will be used in conjunction
with an 'add' button so that the user can quickly add attributes from
the popupbutton that correspond to their document, like categories
such as Friends, Family, Coworkers, etc. I want the popupbutton's
NSMenu to be customizable, so I need an 'Edit list' menuitem always
present.
I would suggest having a look at the Format popup button in AddressBook
on Panther (Print dialog). It's a good UI implementation for such a
thing.
Here are my questions:
1) Is there a way to bind the contents of an NSMenu to an array? Then
I could just add/remove objects from the array during the 'Edit list'
method.
Not dynamically. You would have to clean the Menu first.
2) How do I put in a divider?
By having a look at the NSMenuItem documentation and looking for the
keyword: "separator".
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.