Re: Prevent NSMenuItem selection
Re: Prevent NSMenuItem selection
- Subject: Re: Prevent NSMenuItem selection
- From: Greg Hoover <email@hidden>
- Date: Thu, 18 Oct 2007 21:03:43 -0700
Not exactly. I don't want it greyed out -- just want it not to be
selectable. I suppose I could subclass to get the same effect...but
am hoping not to have to go that route.
BTW-- It's only greyed out if implement the
validateUserInterfaceItem function.
Greg
On Oct 18, 2007, at 8:57 PM, Ron Fleckner wrote:
On 19/10/2007, at 1:34 PM, Greg Hoover wrote:
I have a menu in an nspopupbutton with several sections (there are
heading items) at various locations. I want to prevent these
items from being selectable, similarly to separator items. Can
somebody point me to a solution? The only alternative I see is to
create a custom subclass.
Thanks,
Greg
This works for me:
NSMenuItem *menuItem = [[NSMenuItem alloc]
initWithTitle:@"Whatever" action:NULL keyEquivalent:@""];
You get a greyed-out menu item that doesn't do anything. Is that
what you were after?
Ron
_______________________________________________
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