closing a sheet from another controller
closing a sheet from another controller
- Subject: closing a sheet from another controller
- From: John Love <email@hidden>
- Date: Thu, 24 Jun 2010 09:09:05 -0400
I use one of the standard approaches to opening a NSWindowController sheet; that is, my external Controller calls:
[NSApp beginSheet:...]
each of the IB buttons are connected via IBActions that close the sheet via:
[NSApp stopModal]; // sender = NSButton and [sender window] = sheet
[NSApp endSheet:[sender window] returnCode:theCode]; // calls didEndSelector:
The didEndSelector: looks like:
- (void )sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
which calls:
[sheet orderOut:self];
Fairly standard stuff, but here's the rub. If a error in my app occurs while this sheet is displayed, I want to be able to dismiss the sheet from a external Controller and display an appropriate status message in the sheet's parent window; for example, the external app document (that my application is chewing on) unexpectedly closes. My sheet knows the external Controller that calls +beginSheet: because this external Controller's identity is passed to the method which calls +beginSheet:.
Based on my previous history, there is probably something plainly simple, but I'm just missing it.
Thanks in advance,
John Love
Touch the Future! Teach!
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden