Undo, First Responder, and outsider nibs ...
Undo, First Responder, and outsider nibs ...
- Subject: Undo, First Responder, and outsider nibs ...
- From: SA Dev <email@hidden>
- Date: Thu, 19 May 2005 11:11:10 -0400
List:
I have an NSPersistentDocument-based project. It manages many
"entries". When you click a button to edit the entry, it loads a nib
that contains an 'editor' window. All that is working just fine - it
properly handles updates to the 'entry' object from elsewhere
(receives proper context notifications, etc.). I even included the -
(IBAction)saveDocument:(id)sender in the nib owner's corresponding
controller instance so that when a user hits Cmd-S from within an
editor (and not the main document's window), it's properly forwarded
to the document instance. Ducky.
The trouble now is handling 'undo/redo' requests. I thought it'd
be as simple as the saveDocument problem - just create - (IBAction)
undo:(id)sender and ...redo... and forward those to the document.
Unfortunately, the undo/redo menu items are still disabled, even when
changes are made. I have to switch back to the document's main window
for them to be enabled.
I realize now that since I have two different NSTextViews and
other controls in the nib's window, I'm probably running into a
problem where the poor app doesn't know what the first responder
actually is. So what should I be doing differently for undo/redo than
I'm doing for saveDocument?
_______________________________________________
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