Re: C-Api Documentation - where?
Re: C-Api Documentation - where?
- Subject: Re: C-Api Documentation - where?
- From: Conrad Shultz <email@hidden>
- Date: Fri, 24 Feb 2012 11:33:10 -0800
On 2/24/12 8:31 AM, Gerriet M. Denkmann wrote:
> This is a Cocoa app which uses NSRunloop etc. but which also wants to
> know about kEventAppFrontSwitched. I just looked at
> CarbonEventsCore.h and it says about GetEventParameter:
> AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER and nothing about
> deprecated or legacy.
I don't know Carbon, but I'm guessing from the constant's name that you
want to be informed when the active application has changed?
If so, the following pure Cocoa works for me:
- (void)frontAppChanged:(NSNotification *)note
{
NSLog(@"Changed application: %@", [note userInfo]);
}
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self
selector:@selector(frontAppChanged:)
name:NSWorkspaceDidActivateApplicationNotification
object:nil];
}
The docs indicate that this will require 10.6+.
(If you want to discuss more along these lines, it's probably more
appropriate to cocoa-dev rather than xcode-users.)
--
Conrad Shultz
Synthetiq Solutions
www.synthetiqsolutions.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden