on_enter and on_exit have unnecessary parameters #230

Closed
opened 2026-01-28 04:21:22 +00:00 by john · 1 comment
Owner

Mouse Event Button Parameter

// Enter/exit events use event type as "button":
on_enter_callable->call(mousepos, "enter", "start");  // "enter" is not a button
on_exit_callable->call(mousepos, "exit", "start");    // "exit" is not a button
on_move_callable->call(mousepos, "move", "start");    // "move" is not a button

Problem: Confusing API - the "button" parameter contains event type, not actual button.

### Mouse Event Button Parameter ```cpp // Enter/exit events use event type as "button": on_enter_callable->call(mousepos, "enter", "start"); // "enter" is not a button on_exit_callable->call(mousepos, "exit", "start"); // "exit" is not a button on_move_callable->call(mousepos, "move", "start"); // "move" is not a button ``` **Problem**: Confusing API - the "button" parameter contains event type, not actual button.
john closed this issue 2026-01-28 23:51:03 +00:00
Author
Owner

Cookbook examples updated with new callback signatures in commit 55f6ea9.

Files updated for position-only hover callbacks:

  • tests/cookbook/lib/button.py: _on_enter(pos), _on_exit(pos)
  • tests/cookbook/primitives/demo_click_pickup.py: _on_grid_move(pos)

All cookbook demos now use the correct signatures.

Cookbook examples updated with new callback signatures in commit 55f6ea9. Files updated for position-only hover callbacks: - `tests/cookbook/lib/button.py`: `_on_enter(pos)`, `_on_exit(pos)` - `tests/cookbook/primitives/demo_click_pickup.py`: `_on_grid_move(pos)` All cookbook demos now use the correct signatures.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
john/McRogueFace#230
No description provided.