Re: Help with First Responder
Re: Help with First Responder
- Subject: Re: Help with First Responder
- From: Mike Ferris <email@hidden>
- Date: Mon, 23 Dec 2002 10:08:42 -0800
There's two things to know here...
First, in IB you can add actions to the "First Responder" class. It's
not a real class, but adding methods is the same as for a "real" class
in IB. Select the First Responder, go to the Classes tab, bring up the
Attributes Info, and add.
Second, The NSWindowController of a window, if it has one, is the
window's nextResponder. And, if the NSWindowController has an
associated NSDocument, although NSDocument is not an NSResponder, it
will also get a chance to handle action messages.
So, declare the method on First Responder in your main nib, wire the
menu command to it, and then implement the action in your
NSWindowController subclass or your NSDocument subclass.
Mike
Begin forwarded message:
From: Ted Lowery <email@hidden>
Date: Mon Dec 23, 2002 7:26:38 AM US/Pacific
To: email@hidden
Subject: Help with First Responder
Hi All-
I can't seem to understand how to make the first responder chain work.
I have a menu command that I'd like to send a message to the current
main (key?) window. This is easy enough with the canned messages that
MainMenu's first responder respond to. But what about adding my own
messages? I have a method in the controller for my document that I
can call from a button on the window, but there doesn't seem to be a
way to connect the menu to the document's nib.
Help?
Thanks, Ted
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.