TkinterDnD2 is a python wrapper for George Petasis'' tkDnD Tk extension version 2
Project description
fork
This is fork of tkinterdnd2 which is a python wrapper for tkdnd .
major changes
⭐️Update all platform libtkdnd
files to the latest version, 2.9.3.
⭐️Add support for Apple Silicon macOS, this fork created a fat binary of libtkdnd2.9.3.dylib
that includes both the arm64
and x64
architectures using the lipo -create
command.
this repo forked and edited to be published to pypi so one could simply install this package
with pip install tkinterdnd2-universal
.
install
pip install tkinterdnd2-universal
usage
import tkinter as tk
from tkinterdnd2 import DND_FILES, TkinterDnD
root = TkinterDnD.Tk() # notice - use this instead of tk.Tk()
lb = tk.Listbox(root)
lb.insert(1, "drag files to here")
# register the listbox as a drop target
lb.drop_target_register(DND_FILES)
lb.dnd_bind('<<Drop>>', lambda e: lb.insert(tk.END, e.data))
lb.pack()
root.mainloop()
see any of the demos for usage examples.
tkinterdnd2
Tkinter native drag and drop support for windows, unix and Mac OSX(both x86_64 and arm64).
What is TkInterDnD2
TkinterDnD2 is a python wrapper for George Petasis' tkDnD Tk extension version 2.
It is a domain public project.
What is TkDnD2
tkDnD2 is a tcl/Tk extension adding native drag and drop support.
What this repository is about
It package TkinterDnD2 and tkdnd2 into a standard python module.
When the extension is imported in python its location will be automatically added to the Tk search path.
In this project we use the pre-compiled release from https://github.com/petasis/tkdnd/releases/tag/tkdnd-release-test-v2.9.2 and copy them in tkinterdnd2/tkdnd.
pyinstaller
If you want to use pyinstaller, you should use the hook-tkinterdnd2.py file included. Copy it in the base directory of your project, then:
pyinstaller -F -w myproject/myproject.py --additional-hooks-dir=.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for tkinterdnd2-universal-1.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90101783d8905f4ea04c0a190d4740466b52221375f4b1e99f0b3d5a774df485 |
|
MD5 | 69874efe5427c0b2f38ceac1684b539d |
|
BLAKE2b-256 | d45987937e17986ea7899440d500afd7f4743ab2f3ecdfed77f290b3e93c235b |
Hashes for tkinterdnd2_universal-1.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e5365d92baaf5392ab90c288618df350d534cd4a81891a48b5d78ad0ac51d2d |
|
MD5 | 6af0857fc400560ffa23a8357a296d2b |
|
BLAKE2b-256 | 8b304fd4663762c5df9095ab4078a59c2e26d8894b953de87f65859d2d391c39 |