On 05/03/2009, at 11:39 AM, Dave wrote:

With regard to Menus and PopUpButtons;
How do I get the item tag using the indexOfSelectedItem?


with a pop-up button:

[[popUpButton itemAtIndex:[popUpButton indexOfSelectedItem] tag];

or far more simply:

[[popUpButton selectedItem] tag];



For a plain NSMenu, your question doesn't have an answer, because NSMenu doesn't have a concept of a "selected item" and doesn't implement -indexOfSelectedItem, -selectedItem or anything similar.

--Graham


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to