On Sep 3, 2008, at 16:05, Rick Mann wrote:

However, I don't seem to be able to change the selected item in the collection view. A third view, bound to the NSArrayController that runs the collection view, shows the values in the first object in the collection view. But if I try to click on the second item, nothing happens.

I read some stuff online that suggested I need to write my own drawing code to show the selection highlight, but lacking that shouldn't keep the collection view from handling clicks and selecting different items, should it?

My NSCollectionItemView is an NSView containing a custom view and two labels. All three of these show the correct values. The CollectionView has "selectable" set.

What am I missing?

I never got it to work either.

Part of it, I think, is you have to override the view hit testing to prevent clicks from being consumed by the individual views in the collection. If you look at Apple's IconCollection sample code, you'll see a hitTest: override that appears to serve this purpose.

But even after I tried to do something similar, I never got the collection to select things using the mouse, so I gave up. (It does work in IconCollection, but I couldn't find out why, or what was different.) That was the 3rd time I gave up trying to use NSCollectionView for something or other.


_______________________________________________

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