Re: Drag and drop onto the desktop?
Re: Drag and drop onto the desktop?
- Subject: Re: Drag and drop onto the desktop?
- From: Brian Webster <email@hidden>
- Date: Thu, 6 Dec 2001 14:02:14 -0600
The APIs for handling Carbon to Cocoa drag conversions are
currently private, and I'm not sure if they're ever intended to
be made public. There might be some way to put a Carbon flavor
onto a Cocoa pasteboard, but if there is, it certainly isn't
documented anywhere.
So the only drag types that will work between Carbon and Cocoa
are those supported by Apple. I believe that a dragged OmniWeb
URL actually contains a NSStringPboardType along with URL. Text
dragging is supported, so the Finder can make the URL file from
the dragged text. Dragging existing files is supported
(NSFilenamesPboardType <-> kDragFlavorTypeHFS), but new files
(NSFileContentsPboardType <-> kDragFlaverTypePromiseHFS) are
not. You can do a search in the list archives to see previous
discussions on hacks that kinda sorta work to use existing file
dragging to mimic making new files.
On Thursday, December 6, 2001, at 12:59 PM, jgrosjean wrote:
Can i just say that i provide the promiseHFSFlavor type when i
start the drag operation and then will things work? Where would
i go to find out how to do this? Are there any examples of
declaring Carbon drag types on a Cocoa pastboard and what would
i have to do to my NSData to make it compatible with the
promiseHFSFlavor type?
Oh one last thing... I think with Omniweb you can drag URL's to
the finder. Anyone know how they doing that?
Thanks,
Jesse
---------- Original Message ----------------------------------
From: Brian Webster <email@hidden>
Date: Thu, 6 Dec 2001 11:07:42 -0600
Your code is correct. The problem is that Apple does not yet
support the translation of NSFileContentsPboardType to the
Carbon equivalent promiseHFSFlavor in inter-Carbon-Cocoa drag
and drop. So as of now, it's impossible to create new files in
the Finder from Cocoa drags.
P.S. They might be more inclined to fix this if it should
happen to show up in a lot of bug reports somehow.
*cough*bugreport.apple.com*cough* :-)
--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster