Re: Global notification when front process changes
Re: Global notification when front process changes
- Subject: Re: Global notification when front process changes
- From: Kristin Webster <email@hidden>
- Date: Thu, 5 Sep 2002 17:11:52 -0700
Hi Patrick,
Unfortunately, this doesn't work right now. The problem is that we
don't send events to the Carbon dispatcher if there is a Cocoa
equivalent for the event. In this case the
Application/kEventProcessSwitched event contains a process notification
event.
However, we haven't publicized these notification events in NSEvent.
In most cases we use NSWorkspace notifications to communicate process
notification events, but this case is problematic there too in that we
don't have a process-switch notification. NSWorkspace does have an
-activeApplication method, but that doesn't help with registering to
receive a notification when something changes.
Kristin
From: email@hidden (Patrick Beard)
Date: Wed Sep 4, 2002 09:21:13 US/Pacific
To: Cocoa-Dev Apple <email@hidden>
Cc: Eric Schlegel <email@hidden>
Subject: Global notification when front process changes?
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(handleAppFrontSwitche
d), 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.
_______________________________________________
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.