|
Events and Event Handling
Introduction
Typical Graphical User Interface (GUI) applications operate in response to some actions taken
by the user interacting with the program. The program may ask the user to enter some values, click a button,
adjust a particular value, select a value from a list of possible choices, etc. The program has to
interpret the type of events that could occur and handle the events appropriately.
In this lesson, we will look at a few commonly occurring events and the GUI components (buttons, sliders, etc.)
that generate these events. The event handling portion of the code is separated from the rest of the code
by defining the required set of methods to handle the generated events. In
subsequent lessons, we will study more GUI components and various other events
and different ways of event handling.
Objectives
In this lesson, we will explain:
- what events are and the GUI components responsible for those events
- the event handling mechanism
- various examples demonstrating buttons, slider, and mouse events
|