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:
parent
e9b5a8301d
commit
52a655399e
12 changed files with 20 additions and 20 deletions
|
|
@ -68,7 +68,7 @@ frame.children.append(caption)
|
|||
def frame_clicked(x, y, button):
|
||||
print(f"Frame clicked at ({x}, {y}) with button {button}")
|
||||
|
||||
frame.click = frame_clicked
|
||||
frame.on_click = frame_clicked
|
||||
|
||||
print("Scene setup complete. Setting timer for automation tests...")
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ def test_issue_42_click_callback():
|
|||
try:
|
||||
frame1 = mcrfpy.Frame(10, 10, 200, 150)
|
||||
ui.append(frame1)
|
||||
frame1.click = correct_callback
|
||||
frame1.on_click = correct_callback
|
||||
print("✓ Click callback with correct signature assigned successfully")
|
||||
except Exception as e:
|
||||
print(f"✗ Failed to assign correct callback: {type(e).__name__}: {e}")
|
||||
|
|
@ -80,7 +80,7 @@ def test_issue_42_click_callback():
|
|||
try:
|
||||
frame2 = mcrfpy.Frame(220, 10, 200, 150)
|
||||
ui.append(frame2)
|
||||
frame2.click = wrong_callback_no_args
|
||||
frame2.on_click = wrong_callback_no_args
|
||||
print("✓ Click callback with no args assigned (will fail at runtime per issue #42)")
|
||||
except Exception as e:
|
||||
print(f"✗ Failed to assign callback: {type(e).__name__}: {e}")
|
||||
|
|
@ -93,7 +93,7 @@ def test_issue_42_click_callback():
|
|||
try:
|
||||
frame3 = mcrfpy.Frame(10, 170, 200, 150)
|
||||
ui.append(frame3)
|
||||
frame3.click = wrong_callback_few_args
|
||||
frame3.on_click = wrong_callback_few_args
|
||||
print("✓ Click callback with 2 args assigned (will fail at runtime per issue #42)")
|
||||
except Exception as e:
|
||||
print(f"✗ Failed to assign callback: {type(e).__name__}: {e}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue