• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: C-Api Documentation - where?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >C-Api Documentation - where? (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: C-Api Documentation - where? (From: Sean McBride <email@hidden>)
 >Re: C-Api Documentation - where? (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: "Future" of llvm-gcc with regards to support
  • Next by Date: Re: How to do Intel style inline assembly with LLVM 3.0?
  • Previous by thread: Re: C-Api Documentation - where?
  • Next by thread: Re: C-Api Documentation - where?
  • Index(es):
    • Date
    • Thread