• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSCollectionView and double-clicks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: libPng.dylib: "file is not of required architecture"
  • Next by Date: Re: Use of Mac OS X 10.5 / Leopards Garbage Collection Considered Harmful
  • Previous by thread: Re: libPng.dylib: "file is not of required architecture"
  • Next by thread: CoreData Predicate Question - Retriving child objects
  • Index(es):
    • Date
    • Thread