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
runtime files to the latest version, 2.9.3.
⭐️Add support for Apple Silicon macOS (arm64), Linux on ARM and Windows on ARM.
tkdnd
├── linux-arm64
│ ├── libtkdnd2.9.3.so
│ ├── pkgIndex.tcl
│ ├── tkdnd.tcl
│ ├── tkdnd_compat.tcl
│ ├── tkdnd_generic.tcl
│ ├── tkdnd_macosx.tcl
│ ├── tkdnd_unix.tcl
│ ├── tkdnd_utils.tcl
│ └── tkdnd_windows.tcl
├── linux-x64
│ ├── libtkdnd2.9.3.so
│ ├── pkgIndex.tcl
│ ├── tkdnd.tcl
│ ├── tkdnd_compat.tcl
│ ├── tkdnd_generic.tcl
│ ├── tkdnd_macosx.tcl
│ ├── tkdnd_unix.tcl
│ ├── tkdnd_utils.tcl
│ └── tkdnd_windows.tcl
├── osx-arm64
│ ├── libtkdnd2.9.3.dylib
│ ├── pkgIndex.tcl
│ ├── tkdnd.tcl
│ ├── tkdnd_compat.tcl
│ ├── tkdnd_generic.tcl
│ ├── tkdnd_macosx.tcl
│ ├── tkdnd_unix.tcl
│ ├── tkdnd_utils.tcl
│ └── tkdnd_windows.tcl
├── osx-x64
│ ├── libtkdnd2.9.3.dylib
│ ├── pkgIndex.tcl
│ ├── tkdnd.tcl
│ ├── tkdnd_compat.tcl
│ ├── tkdnd_generic.tcl
│ ├── tkdnd_macosx.tcl
│ ├── tkdnd_unix.tcl
│ ├── tkdnd_utils.tcl
│ └── tkdnd_windows.tcl
├── win-arm64
│ ├── libtkdnd2.9.3.dll
│ ├── pkgIndex.tcl
│ ├── tkdnd.tcl
│ ├── tkdnd2.9.3.lib
│ ├── tkdnd_compat.tcl
│ ├── tkdnd_generic.tcl
│ ├── tkdnd_macosx.tcl
│ ├── tkdnd_unix.tcl
│ ├── tkdnd_utils.tcl
│ └── tkdnd_windows.tcl
└── win-x64
├── libtkdnd2.9.3.dll
├── pkgIndex.tcl
├── tkdnd.tcl
├── tkdnd2.9.3.lib
├── tkdnd_compat.tcl
├── tkdnd_generic.tcl
├── tkdnd_macosx.tcl
├── tkdnd_unix.tcl
├── tkdnd_utils.tcl
└── tkdnd_windows.tcl
7 directories, 56 files
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
tkDnD 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 made pre-compiled libraries from the source code of tkDnD repository and copy them into tkinterdnd2/tkdnd
. The libraries used in this project are based on the latest version of tkdnd, which is 2.9.3.
pyinstaller
If you want to use pyinstaller, you should use the hook-tkinterdnd2.py
( you can find this file here ) file included. Copy it in the base directory of
your project, then:
pyinstaller -F -w myproject/myproject.py --additional-hooks-dir=.
Thanks
@TransparentLC help on hook file for pyinstaller
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.7.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fef2ead89ab89639678b15dfb6e5179bb3cb5485e249174fc6830d6edd117b4 |
|
MD5 | f9131787ac79c678ad9caaed1883e323 |
|
BLAKE2b-256 | 668c0fd1ffc1b78ae471480b5b26281ef657b0f80d25e97197f83d79f99c749e |
Hashes for tkinterdnd2_universal-1.7.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df735023a3415a05b835cff365957b2590d24c460b75c50c12e783ac4b4d6352 |
|
MD5 | eed402d4d80434195bfff18906ac0966 |
|
BLAKE2b-256 | b50c541656cf5c7f08a98386ddf63171f91bdacbc44b00f3a5d4b7162b941448 |