Sheet, window closing, application quitting
Sheet, window closing, application quitting
- Subject: Sheet, window closing, application quitting
- From: Gerben Wierda <email@hidden>
- Date: Wed, 7 Aug 2002 11:13:15 +0200
I have a doc-based app and I am trying to implement some custom sheets.
I'm almost there (thanks to this list also). For testing, I have added
the following methods to my NSDocument subclass (which is also set as
the Owner in the nib file, there are reasons to have this UI-part in the
document which I will not get into now):
- (void)unimplemented
{
if (sheet == nil)
{
// we need to load the nib
if ([NSBundle loadNibNamed:@"UnimplementedSheet" owner:self] == NO)
{
NSRunAlertPanel(@"Error", @"Could not load
UnimplementedSheet.nib", @"Accept defeat", nil, nil);
return;
}
}
[NSApp beginSheet:sheet modalForWindow:[[[self windowControllers]
objectAtIndex:0] window]
modalDelegate:nil
didEndSelector:nil
contextInfo:nil];
}
- (IBAction)endSheet: (id)sender
{
[NSApp endSheet: sheet];
[sheet orderOut: self];
}
The nib file contains a warning panel about an unimplemented feature and
a button which is connected to the endSheet: method of the nib file's
owner. This all works fine (for instance, I can work on a second
document while the first document has a sheet out). Except for two
things:
1. When the sheet is out and the app is not in front, the dock icon is
not jumping, telling the user that something is expected
2. When the sheet is out, quitting the app is just ignored.
I tried adding the sheet to a newly created NSWindowController with
[[NSWindowController alloc] initWithWindow:sheet], but that does not
help. What am I missing here?
G
_______________________________________________
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.