On 12.01.2009, at 05:50, Nick Zitzmann wrote:

Assuming you are trying to create a picture file here, you have to use
the pasteboard type "CorePasteboardFlavorType 0x6675726C" to get the
Finder to accept the drag, and it must contain a file URL string
pointing to the source image that you must write to the disk
somewhere.


You do not really have to create some data for this PB flavor type. It is much simpler. You do not even have know what such a flovor means (I guess it is part of AppleScript).

Do this: somewhere tell the pasteBoard what types you use for dragging:

   NSPasteboard *pb = [NSPasteboard pasteboardWithName:NSDragPboard];
[pb declareTypes:[NSArray arrayWithObject:NSFilenamesPboardType] owner:self];


And eventually (I hope you know where the image is an the disc) you feed the pasteBoard with:

BOOL rtn = [pb setPropertyList:[NSArray arrayWithObject:locationOfTheImage]
                          forType:NSFilenamesPboardType];

(Yes, you need an NSArray of files! ).

Now finally have a look at the dragPasteboard. It contains data for:

   NSFilenamesPboardType
   NeXT filename pasteboard type
   CorePasteboardFlavorType 0x6675726C ( 'furl' )
   Apple URL pasteboard type  (internal name for NSURLPboardType)
   CorePasteboardFlavorType 0x68667320  ( 'hfs ' )


Do not underestimate the power of the PasteBoardServer!

   Godd luck,  Heinrich

--
Heinrich Giesen
gies...@acm.org


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to