Programming terminology: events
A previous note introduced programming terms related to the objects in program user interfaces. This one presents terms for discussing the things a program does. These terms are illustrated by our message output program.
Running that program, we see that it can detect and respond to two events:
- The user clicks on the button that says "Display a message"
- The user clicks on the button that says "Clear the message area"
When the user clicks on the first button, the computer has been programmed to add the characters "Hello my friend!" to whatever was previously displayed in the TextBox.
When the user clicks on the second button, the computer has been programmed to clear the TextBox.
The programmer wrote the instructions telling the computer what it should do when each of these events occurs. Those sub programs are called event handlers. While event handlers may be described in English, they must be written in Visual Basic or some other programming language if the computer is to understand and execute them.