Re: dragging images to the finder
Re: dragging images to the finder
- Subject: Re: dragging images to the finder
- From: Heinrich Giesen <email@hidden>
- Date: Mon, 12 Jan 2009 18:41:47 +0100
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
email@hidden
_______________________________________________
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