Re: Application Activation
Re: Application Activation
- Subject: Re: Application Activation
- From: Jean-Daniel Dupas <email@hidden>
- Date: Sun, 22 Feb 2009 14:41:25 +0100
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@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