Global notification when front process changes?
Global notification when front process changes?
- Subject: Global notification when front process changes?
- From: email@hidden (Patrick Beard)
- Date: Wed, 4 Sep 2002 09:21:13 -0700
On Wednesday, September 4, 2002, at 08:04 AM, Eric Schlegel wrote:
On Wednesday, September 4, 2002, at 07:54 AM, Patrick Beard wrote:
Use the Carbon event kEventAppFrontSwitched.
And if my application is based on Cocoa? Can it still register for
this event?
I think so, but I'm not sure.
This document
http://developer.apple.com/techpubs/macosx/Essentials/CarbonCocoaDoc/
cci_chap2/Carbon_and__mmunication.html
implies that events between the two systems can coexist in the same
application, but it only talks about translation between an NSWindow
and a WindowRef containment hierarchy. However, it doesn't say anything
about whether application targeted events are supported. I wrote the
following in my controller class' awakeFromNib method, and the event
handler never gets called:
static OSStatus handleAppFrontSwitched(EventHandlerCallRef
inHandlerCallRef, EventRef inEvent, void *inUserData);
EventTypeSpec spec = { kEventClassApplication,
kEventAppFrontSwitched };
OSStatus err =
InstallApplicationEventHandler(NewEventHandlerUPP(handleAppFrontSwitched
), 1, &spec, (void*)mStatus, NULL);
Can anybody tell me if there's a Cocoa equivalent for this Carbon
event, or if not, how my application can get the event anyway?
- Patrick
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.