Re: Hooking up Help menu item
Re: Hooking up Help menu item
- Subject: Re: Hooking up Help menu item
- From: Graham Cox <email@hidden>
- Date: Sat, 15 Feb 2014 23:42:37 +1100
On 15 Feb 2014, at 8:40 pm, Roland King <email@hidden> wrote:
> This is the second responder chain issue which has confused me, another menu item had to be hooked up to point directly to an NSView subclass because sending that to First Responder didn't work either. I eventually decided the window wasn't in the chain so it wasn't getting it.
The Window probably was in the chain, if it was active. The view probably wasn't. If you make a NSView subclass, you have to opt-in to becoming first responder by overriding -acceptsFirstResponder (NSResponder) to return YES.
Sometimes it's OK to hook a menu directly to a view rather than FR, but usually only in a single-window app, or where the view is part of a specific app-wide window, rather than, say, a document.
--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