Re: Writing a non-NSDocument based multiple document window apps
Re: Writing a non-NSDocument based multiple document window apps
- Subject: Re: Writing a non-NSDocument based multiple document window apps
- From: mmalcolm crawford <email@hidden>
- Date: Sun, 14 Mar 2004 11:58:07 -0800
On Mar 14, 2004, at 11:36 AM, Steve Palmer wrote:
OK, this one is baffling me and, surprisingly, the online documents
make no mention of this.
This turns out not to be the case (tm mpaque 198mumble)
any menu/UI validation code will need to move to the NSDocument
subclass, and you'll need to have menu items that you've wired up
yourself that don't interact with firstResponder switch to that
design.
If my main menu is in MainMenu.nib but the code to validate and
respond to each item is in the document subclass, how do I hook up the
two?
You don't need to...
I tried dragging MyDocument.h into MainMenu.nib but that didn't work.
Do I have to route all commands through an application controller
class?
<
http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/
Tasks/SubclassNSDocument.html>
Menu items
NSDocument implements validateMenuItem: to manage the enabled state of
the Revert and Save As menu items. If you want to validate other menu
items, you can override this method, but be sure to invoke supers
implementation. For more information on menu item validation, see the
description of the NSMenuValidation informal protocol.
Then:
<
http://developer.apple.com/documentation/Cocoa/Conceptual/MenuList/
Tasks/EnablingMenuItems.html>
see "Automatic Menu Enabling"
General overview:
<
http://developer.apple.com/documentation/Cocoa/Conceptual/
BasicEventHandling/index.html>
mmalc
_______________________________________________
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.