• 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
Drag image creation for NSView with CALayer in NSCollectionView calls drawRect:?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drag image creation for NSView with CALayer in NSCollectionView calls drawRect:?


  • Subject: Drag image creation for NSView with CALayer in NSCollectionView calls drawRect:?
  • From: Lee Ann Rucker <email@hidden>
  • Date: Mon, 14 Mar 2011 13:15:46 -0700
  • Acceptlanguage: en-US
  • Thread-topic: Drag image creation for NSView with CALayer in NSCollectionView calls drawRect:?

I have an NSCollectionView with NSCollectionViewItems that have, amongst other things, a layer-hosting NSView with CALayers. The collectionView has wantsLayers set, and everything there is working nicely - draw, scroll, reorder animation.

The trouble comes when I try to drag them. The collectionView builds the drag image for me, and all the collectionViewItem's children draw except the one with the CALayers. Some digging and logging revealed that the drag image creation code is calling drawRect: on my layer-hosting NSView.

I can work around it by implementing a drawRect: that creates a placeholder drag image, but the question I have is:

Is there something I'm missing that would cause it to create the right drag image for me?

Or is this an Apple bug?
If so, is my workaround good or bad? Is there a case where it will call drawRect: for some other legit reason, or should it just never call it and so when it's fixed my drawRect: will be ignored?_______________________________________________

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

  • Follow-Ups:
    • Re: Drag image creation for NSView with CALayer in NSCollectionView calls drawRect:?
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: CALayers in seperate, overlapping, NSViews don't overlap correctly
  • Next by Date: Re: Drag image creation for NSView with CALayer in NSCollectionView calls drawRect:?
  • Previous by thread: Re: CALayers in seperate, overlapping, NSViews don't overlap correctly
  • Next by thread: Re: Drag image creation for NSView with CALayer in NSCollectionView calls drawRect:?
  • Index(es):
    • Date
    • Thread