Introduction to Event-Based Programming
Learn about event-based programming and click events.
We'll cover the following
Last chapter we were introduced to the
Event-based programming
Imagine boiling some water in a pan. The only way to tell if the water has boiled is to keep checking at regular intervals. This is annoying, because we have to keep stopping what we’re doing to check, and there’s also the chance that we might miss the point when the water boils and it will boil over, making a mess.
The better approach is to use a kettle that whistles when the water boils. This means we can go off and do something else, safe in the knowledge that we’ll be alerted as soon as the water has boiled.
Get hands-on with 1400+ tech skills courses.