Drag and Drop in Tkinter?

11,069

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.

Share:
11,069

Related videos on Youtube

Richard
Author by

Richard

I'm boring. Why would people want to know about me...?

Updated on June 04, 2022

Comments

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

  • Richard
    Richard about 11 years
    Thanks for the fast response. From the quoted documentation, may I assume that tkdnd and tk dnd are two separate things?
  • Richard
    Richard over 10 years
    Will take a look. Thanks.
  • Robert Lugg
    Robert Lugg over 9 years
    I know links aren't especially popular on SO, but this write-up was of great value figuring out how dnd works Tkdnd