Re: NSDocument: Connecting the menubar to objects?
Re: NSDocument: Connecting the menubar to objects?
- Subject: Re: NSDocument: Connecting the menubar to objects?
- From: "Theodore H. Smith" <email@hidden>
- Date: Tue, 14 Jun 2005 12:49:39 +0100
On 14 Jun 2005, at 04:07, Fritz Anderson wrote:
On 13 Jun 2005, at 5:09 PM, Theodore H. Smith wrote:
I'm wondering how do I connect the menubar to objects, in an
NSDocument based project.
Heres what I have: One nib with a file's owner of NSApplication,
and all the menu targets connected up to the app.
Another nib with a file's owner of MyDocument (NSDocument subclass).
I want the menu to call action targets in the the document.
How do I do this? Must I subclass NSApplication to redirect the
stuff across to MyDocument? But that wouldn't work, would it,
because the NSApplication is already instantiated for me.
So how do I do this? I can't figure it out.
The front NSDocument is automatically in the responder chain. Link
the menu items to the First Responder, and the action method will
get shopped up the chain until it hits your document subclass.
Review the NSResponder/responder chain documentation.
Hi Fritz,
My NSDocument subclass needs to get the message "moveFileUp", which
will move the selected file in my UI, upwards.
There is no "moveFileUp" message listed in the first responder in
InterfaceBuilder. I also can't change the custom class of the first
responder.
So how do I link any object to the menu, when the object is defined
in another nib? Can I add messages to the first responder in IB? But
I can't see anyway to add messages in IB.
_______________________________________________
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