Files
lightgui_python/examples
Muse 16ebfd719b Stage 2 monitor app: Task Manager clone (Processes + Performance tabs)
Python port of the Task Manager clone: TPageControl with two tabs
(tab clicks need app-level hit handling, fixed tab-width 140).
Processes tab is a live XProcessList from /proc (sortable PID /
Program / User / Mem / CPU% columns, header clicks toggle the
direction). Performance tab is XHistoryGraph (60 s CPU + memory),
XCoreGrid (per-core), XUsageBar (Memory, Disk /, Swap), XStackBar
(memory breakdown) and XNetGraph (live /proc/net/dev rates). Data
sampled every 500 ms (GLib timeout); window repaints every 2 s
(a full redraw is ~38 rows x 5 text calls plus the graphs, and
repainting every tick burned ~40% of a core); the process list
refreshes every 2 s. Python monitor widgets draw dark btop-style
panels, so the window background is dark.

Also fixes two XProcessList issues the app exposed: the columns
were fixed offsets drawn for the 360px demo widget (a wide widget
was mostly empty) -> width-relative fractions, same as the C++
widget, plus a v/^ sort marker in the header; and _read_processes
opened /proc/<pid>/status for every process on every scan (671 ms
CPU for 400 processes) -> RSS now comes from stat field 24 and
the uid lookup is cached per (pid, starttime), so a warm scan is
~75 ms (9x faster).
2026-12-05 20:55:30 +00:00
..

LightGUI Python widget examples

One minimal complete program per widget in the LightGUI Python set (562 widgets: 209 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. The 15 X* monitor examples also run a GLib timer that feeds live data (sine waves, or real /proc + systemctl + socket checks for the process / load / monitor widgets) and redraws; their screenshots live in examples/shots/ (taken with tools/shoot_monitor.py).

Run one

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:

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

python3 /opt/lightgui-docs/pythondoc/drive.py gen all
python3 /opt/lightgui-docs/pythondoc/drive.py shot all --workers=6