refactor: Rename click property to on_click (closes #139)

Breaking change: callback property standardized to on_* pattern.
- `drawable.click` → `drawable.on_click`

Updated all C++ bindings (8 files) and Python test usages.
Note: src/scripts changes tracked separately (in .gitignore).

This establishes the naming pattern for future callbacks:
on_click, on_enter, on_exit, on_move, on_key, etc.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
John McCardle 2025-11-27 22:31:53 -05:00
commit 52a655399e
12 changed files with 20 additions and 20 deletions

View file

@ -437,7 +437,7 @@ class SweetButton:
# box w/ drop shadow
self.shadow_offset = shadow_offset
self.base_frame = mcrfpy.Frame(pos=(x, y), size=(box_width+shadow_offset, box_height), fill_color=(0, 0, 0, 255))
self.base_frame.click = self.do_click
self.base_frame.on_click = self.do_click
# drop shadow won't need configured, append directly
if shadow:

View file

@ -127,7 +127,7 @@ class TextInput:
self.parent_frame.children.append(self.frame)
# Click handler on the input frame
self.frame.click = self._on_click
self.frame.on_click = self._on_click
def _on_click(self, x, y, button, state):
"""Handle mouse clicks"""