• 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: intercepting NSBrowser multiple selection extension with shift down/up arrow
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: intercepting NSBrowser multiple selection extension with shift down/up arrow


  • Subject: Re: intercepting NSBrowser multiple selection extension with shift down/up arrow
  • From: Andy Lee <email@hidden>
  • Date: Tue, 14 Oct 2008 03:12:03 -0400

On Oct 14, 2008, at 12:45 AM, Martin Redington wrote:
On Tue, Oct 14, 2008 at 5:25 AM, Andy Lee <email@hidden> wrote:
How about if you leave the matrix class alone and do [myBrowser
setSendsActionOnArrowKeys:YES]? Then give the browser a target and action,
and in the action method do whatever you have to do.

That sounds promising, although a bit disappointing and possibly still a tiny bit hacky.

It works for me. I did a quick test and it caught all the cases I tried, though I may have missed something. If it helps with the ick factor, I would say that it's much less hacky to take advantage of one method's documented purpose -- "do something when the selection changes, even if it's via keyboard" -- than to do trivial overrides of multiple methods that you select by trial and error.


The only possible issue I found with this approach is that it also catches at least one case where the selection *isn't* changing: if you have just one cell selected and you click it, the action method will be called even though the selection hasn't changed. That should be easy to work around if it causes a problem.

Surely it shouldn't really be that hard to capture/intercept selection
changes - to have to resort to trial and error over-riding of
selectXXX, et al. methods is a bit irksome.

I agree, it seems a weird omission, given that with NSTableView you have a choice of using either a delegate method or a notification for that very purpose.


--Andy

_______________________________________________

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


  • Follow-Ups:
    • Re: intercepting NSBrowser multiple selection extension with shift down/up arrow
      • From: "Martin Redington" <email@hidden>
References: 
 >intercepting NSBrowser multiple selection extension with shift down/up arrow (From: "Martin Redington" <email@hidden>)
 >Re: intercepting NSBrowser multiple selection extension with shift down/up arrow (From: Andy Lee <email@hidden>)
 >Re: intercepting NSBrowser multiple selection extension with shift down/up arrow (From: "Martin Redington" <email@hidden>)

  • Prev by Date: Re: NSCollectionView - getting notified of selection change?
  • Next by Date: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning
  • Previous by thread: Re: intercepting NSBrowser multiple selection extension with shift down/up arrow
  • Next by thread: Re: intercepting NSBrowser multiple selection extension with shift down/up arrow
  • Index(es):
    • Date
    • Thread