Socket
Socket
Sign inDemoInstall

tkinterDnD

Package Overview
Dependencies
0
Maintainers
1
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tkinterDnD

A python tkinter drag and drop system.


Maintainers
1

Readme

tkinterDnD

Tkinter Drag-N-Drop module. Import this module with

import tkinterDnD as dnd

To make a widget draggable, do

dnd.make_draggable(widget)

To make a draggable widget inside a frame, do

dnd.make_draggable(frame)
dnd.make_draggable_component(widget)

Here's an example of this module being put to use.

import tkinter
import tkinterDnD as dnd
tk = tkinter.Tk()
tk.title("tkinterDnD")
frame = tkinter.Frame(tk, bd=4, height=64, width=64, bg="red")
frame.place(x=0,y=0)
dnd.make_draggable(frame)
label = tkinter.Label(frame, text="Hello", bg="red", wraplength=64, justify=tkinter.CENTER)
label.config(highlightbackground="black")
label.place(relx=0.5, rely=0.5, anchor=tkinter.CENTER)
dnd.make_draggable_component(label)
frame = tkinter.Frame(tk, bd=4, height=64, width=64, bg="green")
frame.place(x=0,y=0)
dnd.make_draggable(frame)
label = tkinter.Label(frame, text="World", bg="green", wraplength=64, justify=tkinter.CENTER)
label.config(highlightbackground="black")
label.place(relx=0.5, rely=0.5, anchor=tkinter.CENTER)
dnd.make_draggable_component(label)
tk.mainloop() 

Side note: The module has a default snap grid of 16x16 units.

FAQs


Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc