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.

Picture_Chooser

In this application a user can choose an item from a popupmenu (an object). This action will trigger a “Change”event in the popupmenu and it will respond according to the code (instructions) in Change event.

At the right is the code contained in the PopUpMenu’s Change event. Sample_Project 2This code is used to change the picture resource that is displayed in the Canvas 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 Canvas will change accordingly, confirming for the user that the selection was successful.