How to accept a drag&drop item?

J. Landman Gay jacque at hyperactivesw.com
Thu Aug 25 19:36:23 EDT 2005


Gajo Csaba wrote:
> 
> Hi,
> 
> I was wondering if there's an easy solution to accepting dragged items 
> that are coming from another application. Specifically, I have a browser 
> window open, and from there I can drag the current link. If I drop it on 
> the desktop, it will turn into a link to that page. 
> And when it gets dropped on my application, I would like the URL to be 
> displayed in a text field. 
> 
> Is there an easy way to do this? I'm guessing I would have to access 
> some system properties because the link is coming from another 
> application, OR....? I would be really surprised if someone would say 
> that this can be done in 1-2 lines of code :)

Well, sort of. :)

on dragEnter
   set the acceptdrop to true
end dragEnter

on dragDrop
     put the dragdata["text"] into me
end dragDrop


Put the above into the field that will display the link.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list