Re: More re: Carbon Events vs Cocoa Events
Re: More re: Carbon Events vs Cocoa Events
- Subject: Re: More re: Carbon Events vs Cocoa Events
- From: Charles Srstka <email@hidden>
- Date: Mon, 1 Apr 2002 15:48:15 -0600
On Monday, April 1, 2002, at 03:36 PM, Tomas Zahradnicky, Jr. wrote:
Charlie,
Well, I just tried it, and unfortunately, it doesn't seem to catch all
events. I downloaded the NoisyApp example, and it doesn't seem to log
Apple Events. If I send the AppleScript 'tell application "NoisyApp" to
beep' it will send the message, and it will beep, but NoisyApp will not
log the event. My little Carbon test app will log the event if I tell
it
to beep...
AppleEvents are a special kind of events. You'll know about them only
if you register an appropriate Apple Event Handler and call
AEProcessAppleEvent function which dispatchs kHighLevelEvt events to
proper handlers (or at least the Mac OS 7,8,9 way). This might be
changed in OS X that RunLoop calls AEProcessAppleEvent for you, so you
don't know about apple events. If you want to catch ALL Apple Events,
just register a handler with type '****' and class '****'. Use
AEInstallEventHandler function for that.
Aha! You are correct, sir. The default code that gets generated when you
choose "Carbon Application" in Project Builder includes
AEInstallEventHandler in its Initialize() function, so indeed, that's
probably what makes my Carbon app able to catch Apple Events. I wonder
if NoisyApp would pick these up if I stuck this function in its init
method...
_______________________________________________
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.