FROM : Jean-Daniel Dupas
DATE : Sun Jun 15 14:10:35 2008
Le 15 juin 08 à 13:25, Mohsan Khan a écrit :
> Hi
>
> I'm trying to to install kEventAppSystemUIModeChanged using
> NSAppleEventManager, so that my app will know when the menubar &
> dock is hidden i.e. some other app enters fullscreen mode.
>
> I've tried entering fullscreen mode using VLC and Photoshop.
>
> handleAppleEvent is never called because there is no log output.
>
> Maybe something is missing or the event is never installed, I have
> no idéa anymore - so its time to ask around.
>
>
> - (void)handleAppleEvent: (NSAppleEventDescriptor *)event
> withReplyEvent: (NSAppleEventDescriptor *)replyEvent;
> {
> NSLog( @"handleAppleEvent called." );
> }
>
>
> - (void)applicationDidFinishLaunching: (NSNotification *)notification
> {
> NSAppleEventManager *eventManager = [NSAppleEventManager
> sharedAppleEventManager];
>
> [eventManager setEventHandler: self
> andSelector: @selector( handleAppleEvent: withReplyEvent: )
> forEventClass: kEventClassApplication
> andEventID: (AEEventID)kEventAppSystemUIModeChanged];
> }
>
>
> Thanks.
kEventAppSystemUIModeChanged is a carbon event not an AppleEvent.
You have to use InstallApplicationEventHandler to handle this event.
DATE : Sun Jun 15 14:10:35 2008
Le 15 juin 08 à 13:25, Mohsan Khan a écrit :
> Hi
>
> I'm trying to to install kEventAppSystemUIModeChanged using
> NSAppleEventManager, so that my app will know when the menubar &
> dock is hidden i.e. some other app enters fullscreen mode.
>
> I've tried entering fullscreen mode using VLC and Photoshop.
>
> handleAppleEvent is never called because there is no log output.
>
> Maybe something is missing or the event is never installed, I have
> no idéa anymore - so its time to ask around.
>
>
> - (void)handleAppleEvent: (NSAppleEventDescriptor *)event
> withReplyEvent: (NSAppleEventDescriptor *)replyEvent;
> {
> NSLog( @"handleAppleEvent called." );
> }
>
>
> - (void)applicationDidFinishLaunching: (NSNotification *)notification
> {
> NSAppleEventManager *eventManager = [NSAppleEventManager
> sharedAppleEventManager];
>
> [eventManager setEventHandler: self
> andSelector: @selector( handleAppleEvent: withReplyEvent: )
> forEventClass: kEventClassApplication
> andEventID: (AEEventID)kEventAppSystemUIModeChanged];
> }
>
>
> Thanks.
kEventAppSystemUIModeChanged is a carbon event not an AppleEvent.
You have to use InstallApplicationEventHandler to handle this event.
| Related mails | Author | Date |
|---|---|---|
| Mohsan Khan | Jun 15, 13:25 | |
| Jean-Daniel Dupas | Jun 15, 14:10 |






Cocoa mail archive

