Files
lightgui_python/examples/README.md
T
Muse 4f9f1bff32 docs(pythondoc): runnable example programs for 5 pilot widgets
Minimal complete programs from the designer codegen (one window, one
widget, OnClick wired), plus examples/README.md. Screenshots taken
under Xvfb prove each runs. Full 547-widget set follows.
2026-12-02 05:54:31 +00:00

42 lines
1.4 KiB
Markdown

# LightGUI Python widget examples
One minimal complete program per widget in the LightGUI Python set
(547 widgets: 194 XFrame + 287 Stock + 66 Instrumentation).
Each file is the LightGUI designer's own Python codegen output for a
project holding just that widget: one window, the widget placed at its
default size, `OnClick` wired to a handler that prints
`EVENT <name> OnClick`. Some widgets get a seeded demo prop so the
screenshot shows something (a gauge gets `value` 65, a combo box gets
three items, a stock chart gets symbol `AAPL`); charts and indicators
render the built-in deterministic demo price series.
## Run one
```sh
PYTHONPATH=/opt/lightgui_python python3 examples/gtkbutton.py
```
From a checkout of this repo, `PYTHONPATH` is the repo root (the
directory holding the `lightgui` package). You need a display; under
Xvfb:
```sh
DISPLAY=:99 python3 examples/gtkbutton.py
```
## How they were made
Generated by `/opt/lightgui-docs/pythondoc/drive.py` on the docs server:
`drive.py gen all` writes these files from `lightgui.model.Project` +
`lightgui.generator.generate`, and `drive.py shot all` runs each one
under Xvfb and screenshots it. The screenshots appear on the widget
pages at https://pythondoc.lightgui.com/.
## Regenerate
```sh
python3 /opt/lightgui-docs/pythondoc/drive.py gen all
python3 /opt/lightgui-docs/pythondoc/drive.py shot all --workers=6
```