Skip navigation.
 
mlRe: Help with First Responder
FROM : Mike Ferris
DATE : Mon Dec 23 19:08:42 2002

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_removed>>
> Date: Mon Dec 23, 2002  7:26:38 AM US/Pacific
> To: <email_removed>
> 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_removed>
> 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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlHelp with First Responder Ted Lowery Dec 23, 16:26
mlRe: Help with First Responder j o a r Dec 23, 16:48
mlRe: Help with First Responder David Rio Vierra Dec 23, 17:01
mlRe: Help with First Responder Mike Ferris Dec 23, 19:08