• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Sheet, window closing, application quitting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Dock Alert: Was: Sheet, window closing, application quitting
      • From: Gerben Wierda <email@hidden>
  • Prev by Date: Re: NSTableView setDoubleAction/NSControl setAction
  • Next by Date: Can launch app as root but not as any other user
  • Previous by thread: Re: Fwd: NSTableView setDoubleAction/NSControl setAction
  • Next by thread: Dock Alert: Was: Sheet, window closing, application quitting
  • Index(es):
    • Date
    • Thread