• 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
Changing the drag image on the fly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changing the drag image on the fly


  • Subject: Changing the drag image on the fly
  • From: David Riggle <email@hidden>
  • Date: Thu, 08 Apr 2010 18:14:10 -0700

I'd like to change the drag image based on the drop location, the way iCal does. I found this tantalizing snippet in the WebCore code:

      if (cocoaImage) {
          // Dashboard wants to be able to set the drag image during dragging, but Cocoa does not allow this.
          // Instead we must drop down to the CoreGraphics API.
          wkSetDragImage(cocoaImage, cocoaLoc);

          // Hack: We must post an event to wake up the NSDragManager, which is sitting in a nextEvent call
          // up the stack from us because the CoreFoundation drag manager does not use the run loop by itself.
          // This is the most innocuous event to use, per Kristen Forster.
          NSEvent* ev = [NSEvent mouseEventWithType:NSMouseMoved location:NSZeroPoint
              modifierFlags:0 timestamp:0 windowNumber:0 context:nil eventNumber:0 clickCount:0 pressure:0];
          [NSApp postEvent:ev atStart:YES];
      }

http://www.opensource.apple.com/source/WebCore/WebCore-1A543a/platform/mac/ClipboardMac.mm

I can't find the implementation to wkSetDragImage(). Does anybody know what CoreGraphics APIs are used to set the drag image?

_______________________________________________

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: Moderator: iPhone OS 4.0 OFF LIMITS
  • Next by Date: NSTableView Key Value Observing performance pickle
  • Previous by thread: Moderator: iPhone OS 4.0 OFF LIMITS
  • Next by thread: Re:Changing the drag image on the fly
  • Index(es):
    • Date
    • Thread