Another delegate method also works:
- (BOOL)applicationShouldHandleReopen:(NSApplication *)theApplication hasVisibleWindows:(BOOL)flag
Could you please tell me if it's OK to use it to ‘unhide’ main window.

Thanks!

On 08.06.2009, at 4:05, 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.

--Andy



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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/aglee%40mac.com

This email sent to ag...@mac.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/mozilla.by %40gmail.com

This email sent to mozilla...@gmail.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to