Re: NSMenuItem enabling
Re: NSMenuItem enabling
- Subject: Re: NSMenuItem enabling
- From: Graham Cox <email@hidden>
- Date: Fri, 15 Oct 2010 17:05:49 +1100
On 15/10/2010, at 3:13 AM, Andreas Höschler wrote:
> The validateMenuItem: method is not implemented or always returns YES: The delegate of the window is my document controller class. This really should work and it does on MacOSX 10.2, but on MacOSX 10.5 the menu items are all greyed out. What am I doing wrong?
I suspect that NSTextView implements the more modern version of -validateMenuItem:, which is -validateUserInterfaceItem: this is stealing the processing that would have gone to -validateMenuItem: under the older OS.
Your text view subclass should override -validateUserInterfaceItem: and validate the menu items, passing anything else to super. Note that the delegate is not necessarily automatically involved if the view implements the validation itself.
I could be wrong on this, but it's got to be worth a try. I've certainly experienced similar symptoms because of this.
--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