Re: NSUndoManager in non-NSDocument Cocoa Applications: unable to change 'Undo' menu item name.
Re: NSUndoManager in non-NSDocument Cocoa Applications: unable to change 'Undo' menu item name.
- Subject: Re: NSUndoManager in non-NSDocument Cocoa Applications: unable to change 'Undo' menu item name.
- From: James DiPalma <email@hidden>
- Date: Thu, 17 Jun 2004 00:54:48 -0700
On Jun 16, 2004, at 3:17 PM, Nick Zitzmann wrote:
On Jun 16, 2004, at 3:26 PM, Frederick C. Lee wrote:
However, I'm not using NSDocument in my appl so I have to create an
'undoManager' instance within the following paradigm:
Actually, you don't. Each responder has its own undo manager, so you
can get the undo manager from the first responder or whatever object.
Then you can interact with that undo manager, and if the object is the
first responder, then you'll see the changes in the Edit menu.
NSResponder has an -undoManager method, but it does not have its own
undo manager, nor does it handle undo:, so it won't be a target for an
undo: action. All Cocoa framework views will return their window's undo
manager which is either established somewhere when using NSDocument, or
is created by that window.
If you have your own NSResponder subclass (an NSView maybe) then it can
do whatever it wants.
-jim
_______________________________________________
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.