[Gambas-user] Drag & drop files

Maria geaplanet at ...397...
Mon Nov 28 10:17:31 CET 2011


Hi!

I was trying drag&drop posibilities in Gambas and I was wondering if you could help me with a problem I found.

I create a button with the DROP property TRUE. Then I write this:

PUBLIC SUB button_Drop() 

DIM a AS String 

  a = Drag.Paste() 
  a = RTrim(a) 
  EXEC ["gedit", a] 
END 


This works.  Drag.Paste get the file I droped, but in an horrible html format, with %20 in spaces and other 
characters like ñ áéíóú, etc... AND starting with "file://"
Gedit works because untherstand this format, butmust commands do not understand this format. AND it finishes with a strange character that I have to cut with RTrim otherwise I would not work.

Now the questions:

How to get a lot of files droped into the button?
How to get real and good path for all applications can untherstand it?

I would like to get a simple application for massive treatment of files, 
for example, to use with "convert" for converting png into jpg, resizing images, rotating, etc... or for using with "lame" for mp3 converting, 
etc...

I  normally use in a terminal bash with $@ for getting all files like parameters, and I do something like this:

for i in "$@"; do 

      convert -rotate -90 "$i" "$i" 

;done 



How to do this in Gambas?

Thanks.



More information about the User mailing list