Re: Tag-At-Selected-Item?
Re: Tag-At-Selected-Item?
- Subject: Re: Tag-At-Selected-Item?
- From: Graham Cox <email@hidden>
- Date: Thu, 5 Mar 2009 14:42:04 +1100
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@hidden)
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:
This email sent to email@hidden