• 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: Tracking Focus Between NSOutlineViews
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tracking Focus Between NSOutlineViews


  • Subject: Re: Tracking Focus Between NSOutlineViews
  • From: Ken Thomases <email@hidden>
  • Date: Sun, 02 Nov 2014 17:22:10 -0600

On Nov 2, 2014, at 4:50 PM, Luther Baker <email@hidden> wrote:

> The outline view delegates fire when a selection changes ... or should
> change -- but they don't say anything if you simply "reselect" an existing
> selection (turning it from GRAY to BLUE).

This is not a selection event.  It's a change of the window's firstResponder.  The outline view shows its selection in blue when it or one of its descendant views is the first responder of the key window.

> Is there a best practice convention to "follow" the active selection so I
> can update the contextual view correctly?

You follow whether or not the window is key by observing the NSWindowDidBecomeKeyNotification and NSWindowDidResignKeyNotification notifications.  If the window delegate implements -windowDidBecomeKey: and/or -windowDidResignKey:, it is made to observe those notifications with those methods automatically.

You can follow a window's firstResponder using key-value observing (KVO).

Regards,
Ken


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden


References: 
 >Tracking Focus Between NSOutlineViews (From: Luther Baker <email@hidden>)

  • Prev by Date: Tracking Focus Between NSOutlineViews
  • Next by Date: Re: Tracking Focus Between NSOutlineViews
  • Previous by thread: Tracking Focus Between NSOutlineViews
  • Next by thread: Re: Tracking Focus Between NSOutlineViews
  • Index(es):
    • Date
    • Thread