What Is A Program Anyway?

A typical program often consists of: a group of objects (such as a window with buttons, text fields, etc.) that the user interacts with called the Interface, the Code that the objects contain to handle events (such as a user clicking a button), and Resources (such as picture files, sound files, text files, etc.) that the objects use to do things.

In the above picture an object, a PopUpMenu, is receiving an event (the user is selecting an item). The code shown in the middle is contained in the PopUpMenu's Change event. This code is used to change the picture resource that is displayed in the ImageWell object.

A user acts on objects in the interface (usually objects in a window) by clicking, double-clicking, dragging, selecting, etc. If the object that the user has acted on contains code that responds to the user's action, the object executes the code for that event. Usually the user will get feedback from the program that the expected response has occurred. In the above example when a user selects a different picture name in the PopUpMenu the picture in the ImageWell will change accordingly, confirming for the user that the selection was successful.