9

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).

nbro
  • 13,796
  • 25
  • 99
  • 185
Richard
  • 325
  • 1
  • 2
  • 12
  • There's been some development - here's a solution: https://stackoverflow.com/questions/14267900/python-drag-and-drop-explorer-files-to-tkinter-entry-widget – nda Jun 21 '18 at 18:39

2 Answers2

6

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.

Bryan Oakley
  • 341,422
  • 46
  • 489
  • 636
  • Thanks for the fast response. From the quoted documentation, may I assume that _tkdnd_ and _tk dnd_ are two separate things? – Richard Apr 22 '13 at 14:40
5

Check out this module, D&D with TK and Python 3.

cdonts
  • 8,768
  • 2
  • 41
  • 69