NSCollectionView and double-clicks
NSCollectionView and double-clicks
- Subject: NSCollectionView and double-clicks
- From: Jens Alfke <email@hidden>
- Date: Thu, 7 Feb 2008 20:18:02 -0800
I had some "fun" this afternoon trying to make NSCollectionView work.
The basics are really easy if you use IB (and peek at the Apple sample
code), and the animations are cool, but it got really hard to make any
nontrivial UI actions work — for example, double-clicking and right-
clicking on collection items.
I did finally succeed, but only after subclassing NSCollectionView and
making a custom NSView subclass for the items, and figuring out the
exact combination of method overrides (-hitTest:, -mouseDown:, -
menuForEvent:...) in both classes. I suspect I may be going about this
the wrong way.
Has anyone worked out any best practices for doing this? Double-click
and contextual menus are so ubiquitous that I imagine anyone who's
used NSCollectionView in a real app is bound to have run into this.
—Jens_______________________________________________
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