Skip to Content
Learn Red ? Fundamentals of Red
book

Learn Red ? Fundamentals of Red

by Ivo Balbaert
May 2018
Beginner content levelBeginner
252 pages
6h 19m
English
Packt Publishing
Content preview from Learn Red ? Fundamentals of Red

Events and actors

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 moveover, or downIf we break them down into categories, we can distinguish the following:

  • mouse events ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

How I Built a Personal Board of Directors With GenAI

How I Built a Personal Board of Directors With GenAI

Vipin Gupta
How to Become a Game-Changing Leader

How to Become a Game-Changing Leader

Douglas A. Ready, Alan Mulally
Why AI Demands a New Breed of Leaders

Why AI Demands a New Breed of Leaders

Faisal Hoque, Thomas Davenport, Erik Nelson

Publisher Resources

ISBN: 9781789130706Supplemental Content