Ann: Tkinter drag and drop module

K

klappnase

I wrote a wrapper for the tkdnd Tk extension
(<http://sourceforge.net/projects/tkdnd>), which adds native drag and
drop support to Tkinter (windows and unix only).
It was the first time for me to try wrapping a Tk extension, and I
couldn't find any documentation on this, so I would still consider it
experimental; however at least for the most part it seems to work well.
The module can be used with both standard Tkinter and Tix, and makes it
quite easy to e.g. drop a bunch of files from a file manager onto any
Tkinter widget.
It comes with a basic reference manual and a small demo app.
It can be found at
<http://www.8ung.at/klappnase/TkinterDnD/TkinterDnD.html>.

Any feedback is much appreciated.

Best regards

Michael
 
T

tchurm

i remember freezing a python console app i wrote some time ago using
the mcmillan installer (kinda like py2exe) and was surprised to
discover that binaries dragged and dropped onto the .exe file were
handled properly as args...making a kind of no-gui drag and drop...

how about a no-gui drag and drop for the console, would such a thing be
possible?
 
B

Bruno Widmann

i remember freezing a python console app i wrote some time ago using
the mcmillan installer (kinda like py2exe) and was surprised to
discover that binaries dragged and dropped onto the .exe file were
handled properly as args...making a kind of no-gui drag and drop...

Do you mean you draged a file onto the .exe using the windows
explorer?

In this case the script just has to read in the first commandline
argument, as the Win-Explorer does the d&d work and passes
the filename of the droped file on to the script.

You can test that easily by creating a small .bat file:
echo %1
pause
 
T

tchurm

yup. that's exactly what i did, on win2k...

somehow, i was surprised that it would work - the filepath + file name
from the binary i'd dragged and dropped onto the .exe file was properly
passed to the frozen python script as an arg...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top