If there's one specific control class that you want to detect focus for, you can subclass it and override becomeFirstResponder. If super returns true, do your thing.
If you want to apply this to a bunch of varied controls, you might want to use a subclass of NSWindow and override makeFirstResponder: (again, checking what super returns). --Andy On Aug 10, 2012, at 8:54 PM, Erik Stainsby <erik.stain...@roaringsky.ca> wrote: > Is it the case that setting up a trackingArea over a given control is the > easiest way to detect the arrival of focus on a given control? > > I'm thinking in terms of tab-advancing keyboard activity here, where the user > advances onto a modestly complex screen region (a postal address displayed in > NSBox holding a multiLineLabel). Upon arrival of focus I want to swap in a > fielded edit interface. > > It seems like this sort of awareness ought to be trivial to glean, but I'm > not seeing it in NSView nor NSControl where I would expect to find it > documented. Advice on where I ought to look? > > TIA > ~ Erik > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/aglee%40mac.com > > This email sent to ag...@mac.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com