
14
Icons
A user may close an application to save space on the display. The program is still running
and it may even be active, but it is not receiving input from the user. In order to represent the
application in its closed state, an icon is used. An icon is a small picture that represents the
application, as shown in Figure 14-1 from the OPEN LOOK GUI Specification Guide.
Figure 14-1. Three bordered default icons
The graphic image that icons use may be used for other purposes and, therefore, may be
shared among other objects in the application. But the icon image should be designed to eas-
ily identify the application while in a closed state. Icons may also have text associated with
them. Space is limited, so the text is usually the name of the application.
14.1 Creating and Destroying Icons
To use the ICON package, include the header file <xview/icon.h>. Figure 14-2 shows the
class hierarchy for the ICON package.
The form for creating an icon is:
Icon icon;
icon = (Icon)xv_create(owner, ICON,
attributes
, NULL);
The owner of an icon is a base frame, but it may be created with a NULL owner. Once an
icon is assigned to a frame, the owner of the icon is changed to that frame. This is another
example of delayed binding.
Icons
Icons 339