tkinterdnd2

0.4.2last stable release 6 months ago
Complexity Score
Medium
Open Issues
N/A
Dependent Projects
7
Weekly Downloadsglobal
35,134

License

  • MIT
    • Yesattribution
    • Permissivelinking
    • Permissivedistribution
    • Permissivemodification
    • Nopatent grant
    • Yesprivate use
    • Permissivesublicensing
    • Notrademark grant

Downloads

Readme

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

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=.

Dependencies

No runtime dependency information found for this package.

CVE IssuesActive
0
Scorecards Score
2.00
Test Coverage
No Data
Follows Semver
Yes
Github Stars
32
Dependenciestotal
0
DependenciesOutdated
0
DependenciesDeprecated
0
Threat Modelling
No Data
Repo Audits
No Data

Learn how to distribute tkinterdnd2 in your own private PyPI registry

pip install tkinterdnd2
Processing...
Done

4 Releases

PyPI on Cloudsmith

Getting started with PyPI on Cloudsmith is fast and easy.