Skip to main content

A package that provides drag/drop and widget resize support directly on a GUI window

Project description

tkinter_dndr

A package that provides tkinter (in python) with support for drag/drop and widget resizing of widgets directly on a GUI window

PLEASE READ THIS FILE TO FULLY UNDERSTAND AND USE THIS PACKAGE WITHOUT ISSUES.

----- GENERAL OVERVIEW OF THE PACKAGE (A tkinter Drag/Drop and Resize Package) -----

tkinter_DnDR is short form for tkinter_Drag/Drop, Resize

This package is one that provides drag/drop and widget resizing support to tkinter widget. What this means is that you (as programmer) can make your widget move to any position on the GUI window (drag/drop). It additionally means that you can resize your widget directly on the GUI window.

For widget resizing, you can resize your widget in any direction you can think of (even diagonally), whether:

  • UP (or NORTH) direction
  • DOWN(or SOUTH) direction
  • RIGHT (or EAST) direction
  • LEFT (or WEST) direction
  • UP-RIGHT (or NORTH-EAST) direction
  • UP-LEFT (or NORTH-WEST) direction
  • DOWN-RIGHT (or SOUTH-EAST) direction
  • DOWN-LEFT (or SOUTH-WEST) direction

----- HOW TO USE THIS PACKAGE -----

First import the tkinter_dndr module. The tkinter_dndr module contains a class called DragDropResizeWidget.

  1. Create an instance/object of the DragDropResizeWidget class. This class receives your widget as a positional argument.

EXAMPLE: instance = DragDropResizeWidget(w), where w is the widget you want to give drag/drop or resize support

NOTE: Any instance of the DragDropResizeWidget class, contains three(3) methods:

a) instance.make_draggable() # Provides only drag/drop support to widget

b) instance.make_resizable() # Provides only resizing support to widget

c) intance.make_draggable_and_resizable() # Provides both drag/drop and resizing support to widget

  1. Call any of the above methods (a,b or c) as you desire

e.g: instance.make_draggable()

  1. NOTE: I HAVE INCLUDED A test_dndr.py file in package directory. Run/Open this file to see and understand how this package works.

----- NOTE -----

-- To use the .make_draggable() method, your widget MUST use the PACK or PLACE layout managers (either .pack() or .place())

-- To use the .make_resizable() method, your widget MUST ONLY use the PLACE layout manager

-- To use the .make_draggable_and_resizable() method, your widget MUST ONLY use the PLACE layout manager

-- If using the .make_resizable() or .make_draggable_and_resizable_method(), you MUST define x,y,width and height in .place() for your widget

e.g: widget.place(x=5, y=10, width=10, height=12)

I will endeavour to make SUBSEQUENT VERSIONS of this package work well with any layout manager (whether .grid(), .pack() or .place())

----- A USAGE EXAMPLE OF THIS PACKAGE -----

See the test_dndr.py file in the package directory for a usage example.

----- AUTHOR OUT 🙂 -----

Feel free to reach me via a Github issue if you have anything you like patched or added.

If your software/project relies on this package fully supporting all layout managers or any other desired support/addition, I am only an email away.

HAPPY TO HELP 😄
IMPROVEMENTS/SUGGESTIONS are welcome 😉

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

tkinter_dndr-0.0.6.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

tkinter_dndr-0.0.6-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file tkinter_dndr-0.0.6.tar.gz.

File metadata

  • Download URL: tkinter_dndr-0.0.6.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.13

File hashes

Hashes for tkinter_dndr-0.0.6.tar.gz
Algorithm Hash digest
SHA256 8808c0e678a29ad1d408522c3d65acb4112e2116e94012c5f08ca33b726595cb
MD5 97acd255f1c9c1c79084abb0b9b5bdf5
BLAKE2b-256 6c73ffe9b4619ef40c08f42dc8edc14864e13de7cd8cf55dffb865ece0bbe45e

See more details on using hashes here.

File details

Details for the file tkinter_dndr-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: tkinter_dndr-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.13

File hashes

Hashes for tkinter_dndr-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d3e70fae87c663a0e5edf7dd67e51f42b7a4259053b2a549e26c78c00cd563db
MD5 27cd85c583b7400ac1b2fc09a7e37e9d
BLAKE2b-256 1224c42090a6048faf5f420b5b4ad042121cdf4a2b712f50e25d58fa051c325a

See more details on using hashes here.

Supported by

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