Drag and Drop in Tkinter?
Solution 1
Tkinter has no built-in support for dragging and dropping between applications. Tkdnd is, AFAIK, the only way to accomplish it without writing the low level code yourself.
Solution 2
Check out this module, D&D with TK and Python 3.
Related videos on Youtube
Comments
-
Richard almost 2 years
What is the correct/official/proper/recommended way of accomplishing drag/drop in tkinter? My documentation section 24.1.1 includes:
Tkdnd Drag-and-drop support for Tkinter. This is experimental and should become deprecated when it is replaced with the Tk DND.
but I can find no other official documentation. Does Tkinter have drag/drop support at all? Is this something version dependant? Is this something not yet included in tk(tcl) which will then filter through to tkinter?
I should stress that I am talking about drag/drop between different applications and that I am currently using python 2 (although any solution which relies on python 3 would still be of interest).
-
nda almost 6 yearsThere's been some development - here's a solution: stackoverflow.com/questions/14267900/…
-
-
Richard about 11 yearsThanks for the fast response. From the quoted documentation, may I assume that tkdnd and tk dnd are two separate things?
-
Richard over 10 yearsWill take a look. Thanks.
-
Robert Lugg over 9 yearsI know links aren't especially popular on SO, but this write-up was of great value figuring out how dnd works Tkdnd