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 except Windows on ARM
libtkdnd
files to the latest version, 2.9.3.
⭐️Add support for Apple Silicon macOS, and Linux on ARM.
.
├── 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-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
6 directories, 46 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
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.5.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2a42e6089e166b44b11a03c59bbdc0b68bd6e403c774ef9ed46c6c5f31620ea |
|
MD5 | 1fd742e3aae3ae7d70197afa468cf5b7 |
|
BLAKE2b-256 | c5df5ddb3070766b15a0cbedd53c154e75d341bd7f7e5930c81fa4d4163eada0 |
Hashes for tkinterdnd2_universal-1.5.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a299412dfba32ff1a014095b1f5c1e9130c44ed109f062a1f075af50cbe6a6c4 |
|
MD5 | f0cd87f8eb46d38f99ef8d7382a41ab5 |
|
BLAKE2b-256 | c5aa78aed3e823c010cd430750b3779eb3a981b6264278ae0b9870c87419ff87 |