Re: Selection in NSCollectionView
Re: Selection in NSCollectionView
- Subject: Re: Selection in NSCollectionView
- From: Quincey Morris <email@hidden>
- Date: Thu, 4 Sep 2008 00:56:35 -0700
On Sep 3, 2008, at 23:32, Markus Spoettl wrote:
I don't know about how to make this work with compound views - by
that I mean views containing other standard Cocoa subviews. I can
imagine things get considerably more difficult because those sub
views all have their own event handling implemented (mouse,
keyboard). I also failed to make this work in my early tests, if I
remember correctly the hitTest thin never worked (I could be wrong -
it was several months back).
...
For this to work you need to implement a custom NSCollectionViewItem
subclass that overwrites -setSelected:. ...
Well, for me the answer is somewhat academic, since I gave up and
moved on. But, what you describe makes sense, because the individual
views do get their events, and programmatic selection does work.
However, the limitation is that this drives the selection mechanism
down into individual views, and forces you to reinvent all the
selection interface behavior, as it applies to the collection as a
whole.
The IconCollection sample code doesn't do this. If you drag over the
collection, you get a marquee rectangle that selects everything inside
it. I see no code to do this (beyond the hitTest override at the
individual view level), so I concluded that this behavior is in
NSCollectionView itself.
The puzzling part was that I could find no way to enable this behavior
in my own NSCollectionView, and I think that's (basically) what the OP
was saying too.
No doubt I missed something obvious, but considering that prototype
NSCollectionItem bindings also appear to be broken currently, any time
spent fiddling with NSCollectionView felt to me like a waste.
_______________________________________________
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