• 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
Converting a LDragTask to Cocoa's dragImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Converting a LDragTask to Cocoa's dragImage


  • Subject: Converting a LDragTask to Cocoa's dragImage
  • From: Eric Gorr <email@hidden>
  • Date: Thu, 26 Mar 2009 13:19:26 -0400

I have a old LDragTask that looks like:

LDragTask drag( ..., ..., ..., kMyDragType, &data, sizeof(DataType*), flavorNotSaved );

Eventually,

GetFlavorType(inDragRef, inItemRef, 1, &flType);

is called and flType is assigned the value of kMyDragType.


The question is how do I setup the pasteboard that is passed with dragImage so that GetFlavorType will be able to extract the correctly flavorType?


I thought something like this might work:

NSPasteboard *dragData
NSString     *dragType = NSFileTypeForHFSTypeCode( 'Drg1' );

[dragData declareTypes:[NSArray arrayWithObject:dragType] owner:self];
[dragData setData:[NSData dataWithBytes:&item length:sizeof( item )] forType:dragType];


but, GetFlavorType does not reliably assign 'Drg1' to flType...what's weird is that it works every once in awhile, but fails most of the time. I figure that when it was working, I was just getting lucky.

So, what is the right way to do this? Anyone know?





_______________________________________________

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: Converting a LDragTask to Cocoa's dragImage
      • From: Eric Gorr <email@hidden>
  • Prev by Date: Shortcut handling in different keyboard layouts
  • Next by Date: Re: Shortcut handling in different keyboard layouts
  • Previous by thread: Re: Shortcut handling in different keyboard layouts
  • Next by thread: Re: Converting a LDragTask to Cocoa's dragImage
  • Index(es):
    • Date
    • Thread