One minimal complete program per widget, from the designer codegen
(one window, one widget, OnClick wired). Every example was run under
Xvfb and screenshotted (547/547 ok); screenshots appear on the widget
pages at pythondoc.lightgui.com.
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.
The Python generator is GTK-based and hit-tests to one widget, so it never had the every-widget loop; its bug was that _on_button_release dispatched OnMouseUp to the widget under the release point. It now tracks _PRESSED on ButtonPress (via a new _dispatch_to helper) and dispatches OnMouseUp to _PRESSED on release, then clears it. Motion/key are not wired in the Python generator (RUNTIME_EVENTS is click-only), so there is no every-widget loop for them to fix. New test test_task4_release_goes_to_pressed_widget asserts the emitted code; full suite 282 tests pass. Verified live under Xvfb with a generated 2-button app: press Button A, release over Button B -> only A's OnMouseUp fires (log shows MOUSEUP A, never MOUSEUP B). The designer canvas does not broadcast release/motion to widgets, so it is unchanged.
27 widgets (18 dialogs, 2 calendars, 3 views, 4 choosers) get larger PaletteEntry defaults in lightgui/xframe/palette.py; canvas places at entry.default_w/default_h. New test Task3MinSizesTests asserts all 27; updated the AboutDialog size assertion in test_core.py. Full suite: 281 tests pass. Verified live under Xvfb: dialogs place at the new sizes (e.g. GtkAboutDialog 520x260). Two residual internal-layout collisions (TFindDialog Direction/Find Next, GtkFileChooserDialog Name/path) are draw-code issues, not placement size.
Task 1: placing a widget now disarms placement mode — the next canvas
click places nothing until another palette widget is selected. Escape
and clicking the selected palette row again also cancel an armed
placement. Previously pending_kind persisted across placements, so
every click placed another fresh widget.
Task 2: placing a widget refreshes the Code window at once
(Lazarus-style) via a new CanvasState.on_placed hook wired to
Application.refresh_code_view(), so the generated code shows the new
widget without pressing Generate.
Tests: replaced test_pending_kind_persists_across_placements with
test_pending_kind_disarms_after_one_placement, plus
test_escape_cancels_pending_kind and
test_on_placed_fires_after_canvas_click_placement (280 tests pass).
Verified live under Xvfb (p-place-verify.sh + screenshots): place-once,
Escape-cancel, toggle-cancel, re-arm, code sync, clean app log.
README: all 7 phases complete, requirements (python3-gi,
python3-cairo, python3-gi-cairo, GTK 3.24), how to run, what works,
actual final module layout (no theme.py/preferences.py/archetypes.py
— those never existed), test command, honest known limits (Install
Libraries root prompt unverified, no logpoint UI, def-line
breakpoint fires at definition time, generated scripts need
lightgui on PYTHONPATH unless installed system-wide).
architecture.md: phase plan actually used (Phases 0-7 with commit
SHAs), final module layout, final state.
- CanvasState on_bounds_change: programmatic resize, set_prop width,
set_bounds/move_to and handle drags fire it; selection changes and
unrelated prop edits do not.
- Inspector refresh_geometry: programmatic resize updates the width/
height spins in place (same editor widgets, no rebuild) and a spin
edit still live-applies; no-op with nothing selected.
- DebuggerWindow: Breakpoints label is the first child of its pane
(above the list) and sits above the tree in window coordinates;
Output label has a 6px top margin.
Fix A: the Breakpoints label sat below the breakpoint list, directly
above the Output label, and the two read as one cramped/overlapping
block at the bottom-left of the debugger window. It now sits above
its list (like Locals in the right pane) and the Output label has
6px top/start margins so it cannot crowd the middle pane.
Fix B: the Inspector only rebuilt on selection change, so a
programmatic resize (set_prop/resize_to/set_bounds) left the
geometry spins stale until the next selection, while canvas and
status bar already showed the new size. CanvasState now fires
on_bounds_change when the selected widget bounds move under the
same selection; the Inspector answers with refresh_geometry(),
which syncs just the four spins in place (no rebuild, no focus
loss). Handle drags fire the same hook, so drags keep working
and now track live.
The draft segment code used its own segment ids (h/i centre
verticals, j/k/l/m diagonals) and drew diagonals as full-length
round-capped strokes, so I/K/M/V/W were wrong and every glyph was
swamped by a dark X blob ("HELLO" unreadable in the showcase
screenshot). This mirrors the C widgets exactly: segment_map()
strings from InstSeg14/16Display5.h, C ids (i/l centre verticals,
h/j/k/m diagonals), C draw_segment geometry (inset bars, hh/hv
verticals) and C draw_diag polygons that stop short of the centre.
Adds per-segment probe tests: every 14-seg glyph vs C map, 16-seg
M/W clean forms, 7-seg 8 vs 1.
27 Phase 6 tests (tables: 103 kinds / 1008 props / 116 names, up-down
defaults, symbol model-only, shadowed VWAP/Arrow names; headless
Cairo smoke over all 103 kinds + with live props; ParallelChannel /
Pitchfork 0/1/2 anchors; tank level 13.78 -> 80 live-apply; short
plot <16px; ProgressBar filled-bar pixels; seeded series invariants;
generator model-only comment). Updates the two Phase 1/2 tests that
encoded the old assumptions (generic-only Stock/Inst tables;
ARCHETYPE == palette archetype for every kind).
Cairo drawings for all 103 kinds in lightgui/xframe/stock.py and
instruments.py (seeded 250-bar demo series so charts show their
colours with no series data; ddaf4bd anchor guard: ParallelChannel /
Pitchfork draw with 0-2 anchors; plot guard below 16px height).
Property tables generated by tools/gen_props_phase6.py from the C
Phase 4 tables (103 kinds, 1008 props, 116 distinct names; symbol
model-only; corrected up/down rgb(0,150,0)/rgb(200,30,30)).
Registry-name dispatch in core.lookup so kind-sharing entries
(IndVWAP/IndAnchoredVWAP kind VWAP, TArrow kind Arrow) keep their
own archetype drawings and generic-only tables.
- debugger.py step_over: pdb stops once more at the --Return--
event inside the finishing function, so one extra `next` lands
in the caller (GDB `next` behaviour). A --Return-- stop at a
breakpoint line is no longer misreported as a breakpoint hit.
- debugger_ui.py: sync hit counts from pdb on every stop so the
breakpoint pane's Hits column shows the real count.
- tests: step over the last line of a function lands in the caller
(new test_step_over_last_line_lands_in_caller).
Full suite: 240 tests pass.
- lightgui/debugger.py: PdbSession driving python3 -m pdb in a
subprocess (start/run/restart, break/enable/disable/clear,
continue, step into/over/out, stack, locals, watches, stop).
State machine idle/running/stopped/exited; stop kills the whole
process group (SIGTERM then SIGKILL) so Stop can never hang on a
GUI app; Run from Stopped/Exited restarts with the current target
and re-applies breakpoints; no temp breakpoints (stop-on-entry
uses pdb's natural first stop, break-on-main is persistent).
- lightgui/debugger_ui.py: debugger window mirroring the C layout
(toolbar, Target row, status, breakpoints left, locals/watches/
stack right, output console). Breakpoint pane 420px / 320px
location column; in-place row updates + id-based selection
restore; checkbox toggles apply to the session first; watch and
locals trees have search disabled (no search popup on click).
- lightgui/install_libs.py: Install Libraries flow (package to
system site-packages, launcher to /usr/local/bin, .desktop to
/usr/local/share/applications); pkexec first, sudo -S fallback
with an Enter-submits password dialog; dry-run plan shown in the
dialog. pkexec is not installed on the server (same honest limit
as the C/Rust fix).
- app.py: Debug menu (Start Debugging, Toggle Breakpoint, Step
Into/Over/Out, Continue, Stop) + Tools > Install Libraries;
debugger stop scrolls the Code window to the stopped line.
- tests: 38 new tests (debugger session incl. breakpoint hit,
step over/into/out, locals, watches, continue to end, stop
kills the debuggee, restart from Exited, enable/disable;
install dry-run command construction/file list/paths).
Full suite: 239 tests pass.
Bulk / Colour sections butted against the window edge and the
palette hint text was clipped at the left. One margin on the
props_box instead of per-widget margins.
Inspector in its own window (LightGUI - Object Inspector, ~340px),
opened on startup beside the designer; closing hides it, palette
pane button reopens it. Scrolled grid: geometry spins, generic set,
custom props, Events group (OnClick etc. as editable text props,
stored as Event=handler in signals). Rows hexpand to fill the panel
width (b96e545/29751be fix); model-only rows flagged with *. Editors
by type: entry, spin -/+, checkbox, enum dropdown, colour entry +
Pick button, font-name entry + Pick button opening a
Gtk.FontChooserDialog (55daf32/6a7c4c7). Live-apply via set_prop.
Selection tracking via CanvasState.on_selection_change (fires only
when the selection moves, so typing never rebuilds the grid).
Bulk parameter (Set all / selected / filtered / Clear param) and
16-swatch colour palette (selected widget, or window background).
Canvas now paints project.background so a root swatch is visible.
Tests: 144 total, all pass under Xvfb.
- Calendar: show-week-numbers now actually draws the ISO week
numbers (44-49 for Nov 2026) in the left column; the column
width was reserved but the numbers were never painted.
- TreeView: the expander triangle is only drawn on rows that have
children (next row starts with path + "/"); leaf rows like
"Other" no longer get a spurious triangle.
- tools/gen_props.py parses /opt/lightgui/src/props.h (common_props +
props_for tables, enum labels/values) and the 547-kind palette,
emitting lightgui/props.py; REQUIRED spot-checks enforce the
proposal SS2.1-SS2.10 lists against the C tables.
- Every kind gets the 43-prop generic set (Name, geometry, Color,
Font Name/Size/Color/Style, Border, Enabled, Visible, Hint,
ShowHint, Cursor, TabOrder, TabStop, Constraints, BorderSpacing,
AutoSize, Tag, Align, Anchors); 38 family custom tables cover the
generic widgets. Stock/Instrumentation get the generic set only
(Phase 6 adds theirs via register_custom_table()).
- Lazarus display names + model_only flags (stored, generator
comments, no live canvas effect); validate() canonicalises
bool/int/double/enum/color or raises ValueError.
- canvas.py imports cairo so the draw signal marshalling works
(needs python3-gi-cairo on the server; installed 3.56.2-1)
- app.py: gi.require_version Gdk + hint label wraps in the palette pane
- README: python3-gi-cairo is a required package