• 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: "Martin Redington" <email@hidden>
  • Date: Tue, 14 Oct 2008 05:45:13 +0100

On Tue, Oct 14, 2008 at 5:25 AM, Andy Lee <email@hidden> wrote:
> On Oct 13, 2008, at 11:16 PM, Martin Redington wrote:
>>
>> I've got an NSBrowser, and a secondary view whose value depends on the
>> current selection in the NSBrowser.
>
> [...]
>>
>> I seem to be capturing everything so far, except for the case where
>> the selection is extended by holding down shift and the up or down
>> arrow key.
>
> It sounds like you're subclassing NSMatrix and using -setMatrixClass: on the
> browser?

Yep. Sorry, I should have made that clearer. I have a custom NSMatrix class.

It was more by trial and error than anything else that I ended up
over-riding the NSMatrix methods - they were just the ones that seemed
to work.

> You might be able to get it to work by also overriding
> -highlightCell:atRow:column:, but this seems like a lot of work.

That sounds nasty. I really just want to post this notification
whenever the selection changes.

> 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.

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'd kind of hoped that I'd simply missed some method that I could
over-ride to cover my broken cases.

> I would think there's an even simpler solution using bindings, but I don't
> know bindings so I can't help you there.

I'm not using bindings in this context, although if anyone does know
it might be of interest for the record.

   cheers,
             m.

>
> --Andy
>
>
>
>



--
http://www.mildmanneredindustries.com/
_______________________________________________

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: Andy Lee <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>)

  • Prev by Date: +(NSSet *)keyPathsForValuesAffectingValueForKey:
  • Next by Date: How to trace a GC error?
  • 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