OSX app close button

When wrtitng an OSX application, how do get the app to exit when I click on the red close button?

You can do this by implementing the applicationShouldTerminateAfterLastWindowClosed: method in your App Delegate and return YES.

OSX app close button
 
 
Q