Add on_hover and on_click to toga.Box
- Dominant language
- Python
- Stars
- 5.4k
- Forks
- 827
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 40
Description
Consider the case you want a visual box to change its color or present a label once hovered. at the moment, this can't be done using *Toga*.
I suggest adding the ability to run a method on click and on hover in `toga.Box`. This is something supported by most of the UI syntaxes such as CSS.
Adding it should be quite easy, just add `on_hover` and `on_click` to `toga.Box` constructor, add the new properties, and add the implementation in the different platforms.
What do you think?
Contributor guide
Research direction
Start by locating the toga.Box constructor and its existing properties, then trace how Box behavior is implemented across the different platforms. Define the callback behavior for hover and click, add the requested properties consistently, and verify that both interactions work on each supported platform.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100