On Tue, Oct 14, 2008 at 5:25 AM, Andy Lee <[EMAIL PROTECTED]> 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 (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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to