• 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
closing window and having application remain running
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: closing window and having application remain running
      • From: "Jordan Krushen" <email@hidden>
  • Prev by Date: [SOLVED] how do I put an object in a dictionary, change the object but leave the dict untouched?
  • Next by Date: how do I determine if this is the first time the app is launched?
  • Previous by thread: Re: objc_msgSend_stret Intel crashes
  • Next by thread: Re: closing window and having application remain running
  • Index(es):
    • Date
    • Thread