The tkinter.dnd module provides drag-and-drop support for objects within a single application, within the same window or between windows. To enable an object to be dragged, you must create an event binding for it that starts the drag-and-drop process. Typically, you bind a ButtonPress event to a callback function that you write (see Bindings and events). The function should call dnd_start(), where source is the object to be dragged, and event is the event that invoked the call (the argument to your callback function).
© Python Software Foundation. PSF License Version 2 · Official docs ↗