Re: Sheets and NSUndomanager
Re: Sheets and NSUndomanager
- Subject: Re: Sheets and NSUndomanager
- From: Michael Petnuch <email@hidden>
- Date: Thu, 22 Sep 2005 21:38:19 -0400
So I implemented the delegate method:
- (NSUndoManager *) windowWillReturnUndoManager: (NSWindow *)sender
{
return [mainWindow undoManager];
}
In my controller file and set the delegate of my sheet to be the
controller. Now when I preform an edit in that sheet the edit menu
is populated; however, it is not clickable until control is restored
to the main window.
I guess the problem is when my sheet appears the edit menu is still
the edit window for the mainWindow and not the sheet. So the sheet
is not considered the frontmost window? Could this be because of the
way I am creating the sheet:
[NSApp beginSheet: recordSheet
modalForWindow: mainWindow
modalDelegate: nil
didEndSelector: nil
contextInfo: nil];
Do I need to call another function.
Thanks.
Michael Petnuch
On Sep 22, 2005, at 7:55 PM, Ryan Britton wrote:
Sheets are technically windows. The NSUndoManager in use by the
undo/redo options in the edit menu is supplied by the frontmost
window's delegate. If you want to have undo/redo for stuff in your
sheet, you'll have to give the sheet a delegate and provide the
undo manager in the proper delegate method of NSWindow.
On Sep 22, 2005, at 4:45 PM, Michael Petnuch wrote:
Hello everyone,
Here is my problem. I have a sheet bound to my main window
which contains some popup buttons and a text view. I have set up
for when they change to have undo be enabled for them. I was
adding this to the sheets undoManager, however, when I do this,
the undo menu does not get enabled. Can sheet's not have undo's?
Thanks.
Michael Petnuch
_______________________________________________
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
_______________________________________________
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