Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Selections in NSCollectionView



I'm trying to use NSCollectionView, and I want to provide visual feedback for the selected item(s) in the collection. The collection view is set to be selectable, and I can find out the selected indexes just by asking it.

Getting from there to the selected NSViews, I get stuck. I thought maybe I could ask the NSCollectionView for its subviews and go from there, but the -subviews array isn't sorted to match the selected indexes (I know it's not documented to be that way but I didn't know what else to try). My NSView subclass can indicate that it's selected, I just can't figure out how to tell the appropriate views that they should do this.

-- Tom Harrington
email@hidden
AIM: atomicbird1

Suppose you have a prototype (NSCollectionViewItem) and it's associated prototypeView (custom view).
Using bindings programmatically, you can bind a property of the prototypeView to the "selected" property of it's prototype. Then use this property to decide when to draw the selection in the prototypeView.


_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.