• 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: How to detect a click on app's dock icon (when the app is active)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to detect a click on app's dock icon (when the app is active)?


  • Subject: Re: How to detect a click on app's dock icon (when the app is active)?
  • From: Stuart Malin <email@hidden>
  • Date: Sun, 7 Jun 2009 15:17:32 -1000


On Jun 7, 2009, at 3:05 PM, Andy Lee wrote:

On Jun 7, 2009, at 8:50 PM, Stuart Malin wrote:
I have a non Document based app. If the window is closed, I want to have the user be able to get it back by clicking on the dock icon. (Note that Apple's Mail does this). I have implemented NSApplication's
- (void) applicationDidBecomeActive:(NSNotification *)notif

Instead of that, implement these:

- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender;

- (BOOL)applicationOpenUntitledFile:(NSApplication *)theApplication;

Have the first one return YES and have the second one reopen your window. They work even in a non-document-based app.


Thanks, Andy; works!

Q: I presume it doesn't matter what value is returned for - applicationOpenUntitledFile (I happen to be returning NO because no file was opened).


but that is only invoked if the dock icon is clicked when the app is not active. I need to know when it is clicked while the app is active. I've looked through various docs, searched with Google, and on Cocoabuilder, but the answer has eluded me._______________________________________________

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: How to detect a click on app's dock icon (when the app is active)?
      • From: Andy Lee <email@hidden>
References: 
 >How to detect a click on app's dock icon (when the app is active)? (From: Stuart Malin <email@hidden>)
 >Re: How to detect a click on app's dock icon (when the app is active)? (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: Using non-id sender in IBAction methods
  • Next by Date: Re: Using non-id sender in IBAction methods
  • Previous by thread: Re: How to detect a click on app's dock icon (when the app is active)?
  • Next by thread: Re: How to detect a click on app's dock icon (when the app is active)?
  • Index(es):
    • Date
    • Thread