Re: Drag&Drop to OSX desktop

Neil Deakin <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xpfe
Message-ID <[email protected]>
On 2012-11-22 6:03 AM, Christian Pernot wrote:
> Hi,
>
> in a xulrunner application, we have drag&drop from distant files to the
> user file manager or application.
>
> It works well on windows and linux (kde at least), but nothing happens
> on OSX. Is there a special flavor for it ?
> We use xulrunner 15.
>
> Here is the part of the code:
>
> ###########
>
> event.dataTransfer.setData("text/x-moz-url", url + "\n" + filename);
> event.dataTransfer.setData("text/x-moz-url-data", url);
> event.dataTransfer.setData("text/uri-list", url);
> event.dataTransfer.setData("text/x-moz-url-desc", filename);
> event.dataTransfer.setData("application/x-moz-file-promise-url", url);
> event.dataTransfer.setData("application/x-moz-file-promise-dest-filename",
> filename);
> event.dataTransfer.setData("application/x-moz-file-promise", null);
> event.dataTransfer.effectAllowed = "copyMove";
>

Are you intentionally trying to use file promises? This should be used 
when the file does not exist. But since you pass null for the 
x-moz-file-promise type, this won't actually do anything.

The code above actually starts a drag for a url.

You may want to read over 
https://developer.mozilla.org/en-US/docs/DragDrop/Recommended_Drag_Types 
for help.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.