closing window and having application remain running
closing window and having application remain running
- Subject: closing window and having application remain running
- From: "Tyler Riddle" <email@hidden>
- Date: Sat, 24 Jun 2006 15:47:21 -0700
Hello,
I have an application that I want to allow users to close the main
window and have the application continue running. I've implemented the
following code in the NSApplication delegate and it works, my question
is: is this the right way to do it?
- (BOOL) applicationOpenUntitledFile:(NSApplication *)app
{
NSWindow* mainWindow = [[app windows] objectAtIndex:0];
[mainWindow makeKeyAndOrderFront: self];
return YES;
}
Is the main window always going to be at index 0? Is there a better
way to get at the main window? I tried [app mainWindow] but that did
not seem to work.
By the way, this is for an open-source rewritable media blanking
program available at http://megablanker.sourceforge.net if anyone is
interested.
Thank you,
Tyler Riddle
--
Quote: "You need only reflect that one of the best ways to get
yourself a reputation as a dangerous citizen these days is to go about
repeating the very phrases which our founding fathers used in the
struggle for independence."--Charles Austin Beard
Web site: http://tylerriddle.com
AIM: The Masta Spice
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden