Skip to main content

TkinterDnD2 is a python wrapper for George Petasis'' tkDnD Tk extension version 2

Project description

TkinterDnD2

Eliav2/tkinterdnd2 is a fork of the (unmaintained) pmgagne/tkinterdnd2 which is a python wrapper for tkdnd .

This repo was originally forked and edited for the purpose of publishing to pypi so one could simply install this package with pip install tkinterdnd2.

This repository is being maintained to ensure availability of tkinterdnd2 into the future.

Install

python -m pip install tkinterdnd2

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.

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

This repo 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.

This repository contains the compiled binaries from https://github.com/petasis/tkdnd/releases/tag/tkdnd-release-test-v2.9.4. In order to provide support on ARM, we include built binaries from the now defunct tkinterdnd2-universal which added ARM support.

pyinstaller

When using pyinstaller, you should use the hook-tkinterdnd2.py file included to collect the TkDnD binaries and build them into the project. To use it, copy it into the base directory of your project, then run pyinstaller as follows:

pyinstaller -F -w myproject/myproject.py --additional-hooks-dir=.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tkinterdnd2-0.4.4.1.tar.gz (425.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tkinterdnd2-0.4.4.1-py3-none-any.whl (474.8 kB view details)

Uploaded Python 3

File details

Details for the file tkinterdnd2-0.4.4.1.tar.gz.

File metadata

  • Download URL: tkinterdnd2-0.4.4.1.tar.gz
  • Upload date:
  • Size: 425.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for tkinterdnd2-0.4.4.1.tar.gz
Algorithm Hash digest
SHA256 e8ca37be9ac4fc37d8d53850f88086a9dcb761ea63d667eaa473ed1c87c7b968
MD5 a939f2c4c9d3fbb62455340dc0d66783
BLAKE2b-256 3d029027f0a22f2132adecc78747f210f83aa967535e98234a8c1e5656069c41

See more details on using hashes here.

File details

Details for the file tkinterdnd2-0.4.4.1-py3-none-any.whl.

File metadata

  • Download URL: tkinterdnd2-0.4.4.1-py3-none-any.whl
  • Upload date:
  • Size: 474.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for tkinterdnd2-0.4.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d1af61a544a2ec6bdec26baa04c0853c97be044fd89816c0879367887419f713
MD5 6fc16e4bb0435c5a23aede435d51f4ab
BLAKE2b-256 3002c351fe199a5ec42bbcb68327e46711699d7271ac622a93277c8caadf3800

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page