Le 22 févr. 09 à 11:56, Gerriet M. Denkmann a écrit :

There are two ways an app can become active:
1. by explicit user action (clicking in Finder, clicking in Dock, using Command-Tab)
or:
2. without user action (frontmost app is closed or hidden, so the next app becomes active).

I would like to perform some action (like displaying an NSOpenPanel) in case 1 (the user wants my app to be active) but not in case 2 (my app becomes active by accident).

Currently I am using NSApplication delegate method applicationDidBecomeActive: - but this gets called in both cases.

Is there a way to diffentiate between these two cases?


You can handle reopen event (using application delegate). This event is send when the user try to reopen your application by double clicking the icon, or when it click on the Dock icon to activate your application.
It will not handle the cmd+tab case thought.

_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to