mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-10 22:07:15 +01:00
Wheel-over-text did not scroll. Tk dispatches through *bindtags*, not the parent chain -- a child's tags are (itself, its class, the toplevel, "all") -- so binding <Button-4>/<Button-5> on `content` was never consulted for an event over a Label sitting on top of it. Content that fills its viewport covers that frame completely, which is every screen this class exists for, so the mouse wheel was dead exactly where a user points it. Found while retiring leetcode-guard's hand-rolled _scrollable, which got this right by accident: it used bind_all, which works but installs the handler on every widget in the application, including other windows' scroll regions. Binding per descendant inside the existing _track_focus walk keeps it scoped, and reuses that walk's WeakSet so a repaint cannot stack duplicate handlers. Verified both directions under xvfb (Button-5 scrolls down, Button-4 back up) from an event generated on a Label, not on the canvas. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U4Rj3s7K2qzrLNgJqqPhno |
||
|---|---|---|
| .. | ||
| tests | ||
| __init__.py | ||
| _arbiter.py | ||
| _density.py | ||
| _detect.py | ||
| _escape.py | ||
| _fitcheck.py | ||
| _guards.py | ||
| _keyboard.py | ||
| _outputs.py | ||
| _recovery.py | ||
| _root.py | ||
| _scrollable.py | ||
| _surfaces.py | ||
| _vt.py | ||
| _window.py | ||
| log_integrity.py | ||
| widget_group.py | ||
| widgets.py | ||