• 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
I can't die from a modal dialog...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: [Newbie Q] Memory Management in Cocoa
  • Next by Date: White background for modal Dialogs/Panels
  • Previous by thread: Re: [Newbie Q] Memory Management in Cocoa
  • Next by thread: White background for modal Dialogs/Panels
  • Index(es):
    • Date
    • Thread