Re: First Responder and menus
Re: First Responder and menus
- Subject: Re: First Responder and menus
- From: Matt Neuburg <email@hidden>
- Date: Tue, 04 Jul 2006 08:35:05 -0700
- Thread-topic: First Responder and menus
On Tue, 4 Jul 2006 08:52:12 -0400, "Alan Smith" <email@hidden>
said:
>I'm trying to hook a menu item in one nib to an action of a controller
>in another nib. I spent this morning reading about First Responder and
>have thoroughly searched the internet. I found lots of articles but
>they all say the same thing: Add an action in the First Responder in
>the nib with the menu item and add an action to the controller. Well,
>I've done that and the menu item remains grayed out. I then tried
>making my controller a NSWindowController, that didn't help either.
Here's a really great trick for these situations. Simply implement
validateMenuItem: in the same class where you hope to receive the action
message, and add some logging so you know whether it's being called. Now run
your app and attempt to choose your menu item. If validateMenuItem: isn't
called, your instance is not in the responder chain and you need to review
your understanding of the responder chain. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden