Most computer applications being developed today, especially ones with
a Graphical User Interface (GUI) are based on a programming
model known as "Event Driven".
The life cycle of these applications all follow the same pattern:
Create and initialize the various user interface components:
menus, buttons, display areas, etc. and register each one's interest
in certain events.
Sit in an infinite loop, wait for events to occur, and dispatch
messages to the user interface components that registered interest in
the event type.