blob: 3831db573eccc6654d4bd654768883ad0285beef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# 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](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](https://stackoverflow.com/questions/3221956/how-do-i-display-tooltips-in-tkinter/36221216#36221216)
Widget that stores a reference to the variable [python - Tkinter widget.cget('variable') - Stack Overflow](https://stackoverflow.com/questions/63871376/tkinter-widget-cgetvariable/63871784#63871784)
Status bar [Create a Status Bar in Tkinter - CodersLegacy](https://coderslegacy.com/python/create-a-status-bar-in-tkinter/)
Mouse wheel on spinbox without ttk [user interface - Enable mouse wheel in Spinbox Tk Python - Stack Overflow](https://stackoverflow.com/questions/38329996/enable-mouse-wheel-in-spinbox-tk-python)
Flashing text box (entry widget) [python - How to make a flashing text box in tkinter? - Stack Overflow](https://stackoverflow.com/questions/27533244/how-to-make-a-flashing-text-box-in-tkinter/78277443#78277443)
### 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](https://stackoverflow.com/questions/19693782/callback-function-tkinter-button-with-variable-parameter)
|