View contents of this chapter

Objects Have Properties

Every object has properties. A command button might have the following properties:

  • Name
  • Color
  • Width
  • Height
  • Picture
  • Text
  • Border

The list convey the kinds of properties that objects have.

Objects Have Events

To exist in an environment, objects must be able to interact with that environment and with other objects that share that environment. For example, a balloon has predefined responses to certain external events. For instance, a balloon would respond to the event of being punctured by deflating itself, or to the event of being released by rising into the air. Similarly, a command button has single-click event, or double-click event.

Objects Have Methods

Objects also have to perform functions of their own. It isn't usually enough that the object exists. The whole point of creating an object is that the object does something useful. These additional functions are known as methods in OOP terms.

For instance, a balloon has inherent methods or actions that it might perform. It has an inflate method (the action of filling it with helium), a deflate method (expelling its contents) and a rise method (if you were to let go of it). Similarly, command button may produce a message when it is single clicked.

Play Sound The code that you write for the program determines which events to ignore and which events to respond.


© Universal Teacher Publications        INDEX Previous Screen Next Screen