In the previous examples, we saw that most faces can have actors, which are event handlers that execute when a certain event occurs on that face. For example, the slider in the code we just explored has a default on-change actor, which is the code in the last block:
slider 100x20 data 25% [t/text: to-string face/data]
Not all faces can respond to all sorts of events. But a lot of faces can respond to multiple events as well.
Red defines some 40 events for which you can define actors on your faces. You can find the complete list here: https://doc.red-lang.org/en/view.html#_events.
Actors all have short names, such as move, over, or down. If we break them down into categories, we can distinguish the following:
- mouse events, such as down, up, drag, drop, click, dbl-click, over, wheel, and so on, including events for all three buttons, the mouse wheel, and hovering...