• 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: [Newbie] How to make application reappear after a close?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Newbie] How to make application reappear after a close?


  • Subject: Re: [Newbie] How to make application reappear after a close?
  • From: "M. Uli Kusterer" <email@hidden>
  • Date: Fri, 7 Jan 2005 18:15:15 +0100

At 1:13 Uhr +0100 07.01.2005, whamoo wrote:
but if i press on dock icon,
only the menu reappear not the window.... How to tell application on a
click on dock if it is close to reappear?

See:

- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication
hasVisibleWindows:(BOOL)flag

in NSApplication docs.

Oks, in this way i can catch the user event click on my icon in the doc, but in which i can restore the windows? There is a way to reopen the windows that the program open when the app is launched the first time?
How to implement this function?

I think you're misunderstanding something here: When you close the last window, you're doing *only* that, you're closing the last window. If you look at the menu bar or the dock after closing your app, you'll see that it is still *running* and the current application. Just that it has no windows open anymore.


If you want your application to actually *quit* when the last window is closed, there's an NSApplication delegate method for that (applicationShouldQuitWhenLastWindowCloses: or something like that).

If you don't want your application to quit, you need to manually reopen the window. E.g. for a document-based application, NSApp will automatically open a new untitled document when you click the dock icon and no documents are open.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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: [Newbie] How to make application reappear after a close?
      • From: whamoo <email@hidden>
References: 
 >[Newbie] How to make application reappear after a close? (From: whamoo <email@hidden>)
 >Re: [Newbie] How to make application reappear after a close? (From: "Sean McBride" <email@hidden>)
 >Re: [Newbie] How to make application reappear after a close? (From: whamoo <email@hidden>)

  • Prev by Date: Re: stringWithContentsOfURL bug? (gzip issue)
  • Next by Date: Info Needed
  • Previous by thread: Re: [Newbie] How to make application reappear after a close?
  • Next by thread: Re: [Newbie] How to make application reappear after a close?
  • Index(es):
    • Date
    • Thread