Re: Responding to Dock Click
Re: Responding to Dock Click
- Subject: Re: Responding to Dock Click
- From: John Stiles <email@hidden>
- Date: Fri, 14 Oct 2005 12:28:35 -0700
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:
This email sent to email@hidden