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 .
This fork is to add support compatitablity of macOS arm64 by create a fat binary of libtkdnd2.9.3.dylib
of both arch of arm64 and x64 via 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-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a22bddb6a4d0b43e5a6c773cd61129c10ca0f5551f1a0cf80d447524ce2159d7 |
|
MD5 | 31a460d722e9b08f317d4b9b1bc19f83 |
|
BLAKE2b-256 | c55917e079f85d2878f65d9b90c91d69774caa2a2a76b314224fc1cd0b18cbc8 |
Hashes for tkinterdnd2_universal-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2ff5c717b26a5853b6e410906b1b63eec6d4ef02e30dc66045a44dfb2ec0601 |
|
MD5 | db85acd1394f0f6d876360e6848be094 |
|
BLAKE2b-256 | f8cf1714b560319a5e4a3b232428244bba67c57f0036d87da920e5d19d0cf02a |