Clicking an application's red close button up in it's top left corner, does this create the same event that is generated by using the Quit Menu option?
Depends. If your application is a "single window" type, then the answer is yes. If it's document-based, and thus has one window for each open document, then no.
If you have a single-window type application and want it to shut down if the main window is closed, you can modify your application delegate by adding the following method:
Code:
// Stop the application when all windows have closed.
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication
{
return TRUE;
}
Then the application will quit when the last window closes. The System Preferences app is an example of this behavior.