aboutsummaryrefslogtreecommitdiff

README for tkstackrpms

Stackrpms extensions to Tcl/Tk for Python. These are small useful additions that might not be useful to anyone else.

Upstream

This project's upstream is at https://bgstack15.ddns.net/cgit/tkstackrpms/

Alternatives

None. Write your own small extensions.

Reason for existence

Some features include:

  • New widgets: Tooltip, Statusbar
  • Extended widgets:
  • Spinbox with mousewheel support
  • Checkbox that calls function on Enter/Space/MouseButton1
  • Entry that calls function on Enter/FocusOut
  • Radiobutton that allows keyboard navigation through all related (by same variable) radiobuttons: Home, End, Up, Down.
  • Poor-man's Gtk 3.0 icon name to path resolution
  • Load image from svg
  • Function flash_entry that cycles through a list of colors, at a provided duration per color. Useful for flashing an error.

My added value includes:

  • The radiobutton keyboard navigation. To make that possible, I had to write a recursive function to find all related radiobuttons (that use the same variable) within this toplevel widget.
  • A vastly improved flash_entry.
  • The reimplementation of gtk 3.0 icon path resolution.

Using

Ideally, this would be installable with pip3. But since I don't know how to do that, perhaps just copy src/tkstackrpms/init.py to your own project as tkstackrpms.py.

Dependencies

For Devuan:

  • python3-tk
  • python3-pil.imagetk
  • python3-cairosvg (OPTIONAL, for svg image support)

Building

References

Building a python package

  1. https://spike.sh/blog/how-to-create-a-pip-package-for-python/
  2. https://packaging.python.org/en/latest/tutorials/packaging-projects/

Contents

Tooltip class python - How do I display tooltips in Tkinter? - Stack Overflow Widget that stores a reference to the variable python - Tkinter widget.cget('variable') - Stack Overflow Status bar Create a Status Bar in Tkinter - CodersLegacy Mouse wheel on spinbox without ttk user interface - Enable mouse wheel in Spinbox Tk Python - Stack Overflow Flashing text box (entry widget) python - How to make a flashing text box in tkinter? - Stack Overflow

General reference

file:///usr/include/X11/keysymdef.h https://insolor.github.io/effbot-tkinterbook-archive/tkinter-events-and-bindings.htm python - Callback function tkinter button with variable parameter - Stack Overflow

bgstack15