Re: NSPopUpButton question (newbie)
Re: NSPopUpButton question (newbie)
- Subject: Re: NSPopUpButton question (newbie)
- From: Rudi Sherry <email@hidden>
- Date: Fri, 11 Mar 2005 10:02:57 -0800
How about pre-pending an index to each history item title like the unix
'history' does? You would have to implement something that stripped it
out when the user selected it or you used it in some other way.
My two cents,
Rudi
On Mar 10, 2005, at 8:11 AM, Charilaos Skiadas wrote:
On Mar 10, 2005, at 3:57 AM, j o a r wrote:
On 2005-03-10, at 10.08, Aaron Boothello wrote:
Is it possible to have more than one item in an NSPopUpButton with
the same title (NSString) ?
The documentation states:
========================================================
- (void)addItemWithTitle:(NSString *)title
Adds an item named title to the end of the menu. If an item with the
name title already exists in the menu, it’s removed, and the new one
is added.
========================================================
So it's probably not a good idea. You might manage to add an item
with a duplicate title if you access the menu directly, I don't
really know, but consider that if you do, these methods might fail /
no longer do what you expect:
I wanted to implement a "history list" pop-up button with text
commands that the user typed, so I wanted to allow multiple items, and
so I accessed the menu directly. It worked fine, though I never have
to remove an item from the list or any the following commands either.
So depends on what you want to do with it I guess.
- (void)removeItemWithTitle:(NSString *)title
- (void)selectItemWithTitle:(NSString *)title
- (id <NSMenuItem>)itemWithTitle:(NSString *)title
- (int)indexOfItemWithTitle:(NSString *)title
- (void)setTitle:(NSString *)aString
j o a r
Haris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden