I can't die from a modal dialog...
I can't die from a modal dialog...
- Subject: I can't die from a modal dialog...
- From: Jerry LeVan <email@hidden>
- Date: Tue, 05 Nov 2002 13:34:26 -0500
Hi,
I am popping up a modal dialog, the dialog contains a "Quit" button. I would
Like to kill the app when the quit button is pressed. The following code
Shows the dialog and when the quit button is pressed, all I get is a beep
And the program continues. NSLog shows that the quit routine is executed but
the [NSApp terminate: self] is ineffective, what am I missing? I get the
same behavior if I swap the two NSApp statements in quitOpenOptions.
- (void) getOpenParameters
{
if (!remoteWindow)
if(![NSBundle loadNibNamed: @"OpenOptions" owner: self])
NSLog(@"Error Loading Nib File"); // need an alert here
// NSLog(@"remote window->%@",remoteWindow);
[NSApp beginSheet: remoteWindow
modalForWindow: [NSApp mainWindow]
modalDelegate: nil
didEndSelector: nil
contextInfo: nil];
[NSApp runModalForWindow: remoteWindow];
// Sheet is up here.
// NSLog(@"run modal just executed");
[NSApp endSheet: remoteWindow]; //required!
[remoteWindow orderOut: self];
}
// user choose quit in getopenoptions
-(void) quitOpenOptions:(id)sender
{
NSLog(@"In QuitOpen");
[NSApp stopModal];
[NSApp terminate:self];
NSLog(@"leaving quit open");
}
Thanks,
Jerry
_______________________________________________
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.