NSPopUpButton addItemWithTitle
NSPopUpButton addItemWithTitle
- Subject: NSPopUpButton addItemWithTitle
- From: Greg Hulands <email@hidden>
- Date: Sat, 5 Oct 2002 21:47:07 +1000
Hi,
I am having trouble with adding items to a pop up button that have the
same name. In the docs
(file://localhost/Developer/Documentation/Cocoa/TasksAndConcepts/
ProgrammingTopics/MenuList/index.html) It says:
To add items to a popup button cell's list, use the methods
addItemWithTitle:, addItemsWithTitles:, and
insertItemWithTitle:atIndex:. These methods create or replace a menu
item with the given title and assign it a default action and key
equivalent. Once the item is added to the list, use NSMenuItem methods
to modify the attributes of the item. To remove one or more items, use
the removeItemWithTitle:, removeItemAtIndex:, or removeAllItems method.
I maybe making an assumption that you can only seem to have one item
with a title in a popup button menu, but i know this is not true as you
can add in interface builder multiple items with the same title. The
remove implies that it will remove multiple items with the title.
I have tried to get the lastItem from the popup to set its represented
object, but since it has not added it, it does not work. How can I add
objects with the same title to a popup button?
TIA,
Greg
_______________________________________________
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.