Re: Adding NSButton in NSMenuItem
Re: Adding NSButton in NSMenuItem
- Subject: Re: Adding NSButton in NSMenuItem
- From: Jens Alfke <email@hidden>
- Date: Tue, 14 Jun 2011 10:04:54 -0700
On Jun 14, 2011, at 6:33 AM, Adil Saleem wrote:
> I want to add a button in front of Label in every NSMenuItem entry. Is using a custom view the only option or does Cocoa provide some other option as well ?
You’ll need a custom view. This is pretty nonstandard UI, so I hope your designers know what they’re doing :)
> And if custom view is the way, then how can we detect that button was pressed in which menu item? Because the selector called on press of button will be for button (not menu item), so how can we detect which NSMenuItem was involved in the button click ?
Set a custom tag on the button, or look at the button’s superview.
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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