[Tkinter-discuss] active icons with drag-and-drop

Michael Lange klappnase at web.de
Thu Apr 27 11:27:58 CEST 2006


On Wed, 26 Apr 2006 18:48:10 -0400
"Eric S. Johansson" <esj at harvee.org> wrote:

> I'm trying a user interface experiment.  the first step involves 
> dragging and dropping from one application onto an icon.  subsequent 
> steps will involve playing with the clipboard, icon changes, single 
> click, double click as well as press and hold for a menu.
> 
> is this something one can do with tkinter without a large amount of 
> complexity or would I be better off looking at other toolkits including 
> native kits?
> 

Hi Eric,

there is no built-in drag and drop support in Tk (I assume you mean to drag e.g. a filename
to an icon on the windows desktop). If you want to do so, you need
the tkdnd extension for Tk (not to be confused with python's Tkdnd module), which
adds native drag and drop support for windows and unix platforms:
    <http://sourceforge.net/projects/tkdnd>
and its python wrapper :
    <http://www.8ung.at/klappnase/TkinterDnD/TkinterDnD.html> .

Please note that the TkinterDnD module was written for tkdnd-1.0, not the brand new tkdnd-2,
which appears to be incompatible with the older release. According to a message on
    <http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/37c43ef2aeb2de18/d2d03a79b955f3d4?lnk=st&q=tkdnd&rnum=4#d2d03a79b955f3d4>

it might work anyway, but I have not done any testing on this yet. Some recent postings on comp.lang.tcl say that tkdnd-2 seems
to be better than tkdnd-1.0, so it might be worth a try.

There are also some issues installing tkdnd-1.0 on windows, because of a missing pkgIndex.tcl file in the distribution,
    <http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/51ee2489273360d/b1b0e7df053c5b7c?lnk=st&q=tkdnd&rnum=8#b1b0e7df053c5b7c>
shows how to fix this.


The other things you mentioned should not be too hard (though I am not really sure what you mean by
"icon changes" and "press and hold for a menu").

Regards

Michael



More information about the Tkinter-discuss mailing list