Skip to main content

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()

tkinterdnd2 example usage

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

petasis/tkdnd

pmgagne/tkinterdnd2

Eliav2/tkinterdnd2

@TransparentLC help on hook file for pyinstaller

Metadata

Release files for tkinterdnd2-universal 1.7.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tkinterdnd2-universal 1.7.3
File Size Uploaded
tkinterdnd2-universal-1.7.3.tar.gz 363.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tkinterdnd2-universal 1.7.3
File Interpreter ABI Platform
tkinterdnd2_universal-1.7.3-py3-none-any.whl Python 3 none any Details

Total release size: 768.1 kB

Release files / tkinterdnd2-universal-1.7.3.tar.gz

Download URL tkinterdnd2-universal-1.7.3.tar.gz
Size 363.4 kB
Tags Source
SHA-256 checksum
How to use checksums
658b68cc6b733176993bfc72ad11d479c6d086c7c89e536668bab51a36c50e98
BLAKE2b-256 checksum
How to use checksums
6f1341448e4c49fd4afb0eaabb442d091fd3cdf0f2f94d95b2030591c7ab37e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / tkinterdnd2_universal-1.7.3-py3-none-any.whl

Download URL tkinterdnd2_universal-1.7.3-py3-none-any.whl
Size 404.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a0a5844c596951ed67c7b8c992abcced67fef87349557250de27419e12f70bf
BLAKE2b-256 checksum
How to use checksums
d67683cb9e213f583719b78e16384a3a3d0d1bf83aabc4c99e3ae7fe735365eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release history Release notifications | RSS feed

This release

1.7.3 This release

2 release files

1.7.2

2 release files

1.7.1

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page