Re: Add duplicate menu items
Re: Add duplicate menu items
- Subject: Re: Add duplicate menu items
- From: Peter Maurer <email@hidden>
- Date: Fri, 24 Sep 2004 15:24:16 +0200
I am looking for a method that does not remove duplicate items. For
instance, "addItemsWithTitles" only adds "thisItem" and "thatItem" to
the
menu, leaving only two menu items. I want five.
Does anyone know how to accomplish this?
How about calling -menu on the NSPopUpButton and then adding items
directly to the underlying NSMenu using either -addItem: or
-addItemWithTitle:action:keyEquivalent:
Exactly. From the documentation for addItemWithTitle/addItemWithTitles:
"Since this method searches for duplicate items, it should not be used
if you are adding an item to an already populated menu with more than a
few hundred items. Add items directly to the receiver's menu instead."
<http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSPopUpButton.html#//apple_ref/doc/
uid/20000275/addItemWithTitle_>
Cheers,
Peter.
_______________________________________________
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