Re: App Listener?
Re: App Listener?
- Subject: Re: App Listener?
- From: Nicolas Seriot <email@hidden>
- Date: Mon, 12 Jan 2009 23:44:08 +0100
Le 8 janv. 09 à 07:46, Chunk 1978 a écrit :
does this work with Dashboard? it seems that dashboard is a
background application that's always open...
It seems that the notification
com.apple.HIToolbox.cancelMenuTrackingNotification is sent when
Dashboard appears.
So while it may have side effects or work differently elswhere or
tomorrow, you may observe it this way:
- (void)awakeFromNib {
[[NSDistributedNotificationCenter defaultCenter] addObserver:self
selector:@selector(menuTrackingWasCancelled:)
name:@"com.apple.HIToolbox.cancelMenuTrackingNotification" object:nil];
}
- (void)menuTrackingWasCancelled:(NSNotification *)aNotification {
NSLog(@"Dashboard was activated (or something else happened).");
}
--
Nicolas Seriot
http://seriot.ch
_______________________________________________
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