• 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: Responding to Dock Click
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Responding to Dock Click


  • Subject: Re: Responding to Dock Click
  • From: SA Dev <email@hidden>
  • Date: Fri, 14 Oct 2005 15:39:02 -0400


Alternatively, you could use the NSApp delgate method - applicationWillBecomeActive: to show your window in the case of windows-based apps.


On Oct 14, 2005, at 3:28 PM, John Stiles wrote:

On Oct 14, 2005, at 12:21 PM, Nick D'Amato wrote:


Hello,

I'm writing a Cocoa single window based app. When the window is closed, I'd like my app to continue running, which happens by default in Cocoa. However, when someone clicks my app's icon in the dock while the window is closed, I would like to automatically reopen my main window (like most apps do).


Is this what most apps do?
I've seen lots of document-based apps which will open a new document when their dock icon is clicked, but that's not really the same thing. For window-based apps, I don't know if it's such a standard thing.


Hmm. The Finder does something like this, but it's not Cocoa based :) The Terminal works this way also, and doesn't appear to be document based... so it's a good idea.


I'm sure there is a default cocoa method to do this, but I cannot find it. Any suggestions would be greatly appreciated!


You could just watch for notifications for when your app becomes active, and then show your window again. Doesn't seem like it'd be more than a few lines of code.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40silentalcove.net


This email sent to email@hidden


_______________________________________________ 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: Responding to Dock Click
      • From: SA Dev <email@hidden>
References: 
 >Responding to Dock Click (From: "Nick D'Amato" <email@hidden>)
 >Re: Responding to Dock Click (From: John Stiles <email@hidden>)

  • Prev by Date: unknown host cvs.Sourceforge.net
  • Next by Date: Re: Responding to Dock Click
  • Previous by thread: Re: Responding to Dock Click
  • Next by thread: Re: Responding to Dock Click
  • Index(es):
    • Date
    • Thread