Access to a Part's Behavior

An action provides access to the behavior of a part. Actions represent the tasks you can assign a part to do, such as open a window or add an object to a collection of objects.

The action interface is represented as follows:

  aType aMemberFunction();

aMemberFunction is the public member function for the action to be performed.

A part implements the action interface by supplying a member function that responds to the behavior declared in the header file. For example, the following member function supports the action interface to set the default value of the city attribute in the IAddress class:

  IAddress & IAddress :: setCityToDefault ()
  {
    return setCity("Hometown");
  }

This example shows that actions can cause values of attributes to change. In fact, most Boolean attributes can be set to false using the disable member function. For example, the disableMouseClickFocus member function in the IButton class causes the mouseClickFocus attribute to be set to false.


Related concepts
Access to a Part's Properties
Notification of Changes to Parts