Files
lightgui_python/tests
cnmcdee 90f7e403ea Task 4: ButtonRelease goes to the pressed widget in generated apps
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.
2026-12-02 05:39:48 +00:00
..