• 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
Re: Quit on close Window?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quit on close Window?


  • Subject: Re: Quit on close Window?
  • From: David Remahl <email@hidden>
  • Date: Sun, 4 May 2003 18:10:11 +0200

On Sunday, May 4, 2003, at 05:57 PM, Michael Hanna wrote:

Like most things in Cocoa, the solution to this is probably obvious and simple, but I'm not clear on how to do it. How do you set a single-window, "MainMenu.nib" program to quit on closure of the > window?

regards,
Michael

In the window delegate, implement:

- (void)windowDidClose:(NSNotification *)notif
{
if( [notif object] == mainWindow )
[NSApp terminate:self];
}

/ Regards, David Remahl
_______________________________________________
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.

References: 
 >Quit on close Window? (From: Michael Hanna <email@hidden>)

  • Prev by Date: Re: Quit on close Window?
  • Next by Date: GUI-less applications and autorelease pool never deallocated ?
  • Previous by thread: Re: Quit on close Window?
  • Next by thread: Re: Quit on close Window?
  • Index(es):
    • Date
    • Thread