[ Previous | Next | Contents | Glossary | Home | Search ]
Motif 2.1 Programmer's Guide



Core, RectObj, XmPrimitive, and XmGadget Classes

Nearly all the basic controls are subclasses of XmPrimitive or XmGadget. XmPrimitive, in turn, is a subclass of the Intrinsics Core class, and XmGadget is a subclass of the Intrinsics RectObj class.

Core

The Core class provides basic attributes of all widgets that have associated windows. It has the following groups of resources:

  1. Specifications of the widget's x and y coordinates, width and height, and border width

  2. A resource specifying whether or not the widget is sensitive or able to receive input events from the Intrinsics event manager

  3. Characteristics of the window, including background and border color or pixmap, colormap, depth, and screen

  4. A resource controlling whether or not the Intrinsics map the window when the widget is managed

  5. A table associating translations with actions

  6. A set of accelerators, which is a translation table bound in the context of a particular widget

  7. RectObj

    RectObj is the foundation for gadget classes; it is essentially Core without the attributes related to having a window. RectObj resources control the position and dimensions of the gadget's rectangular area within its parent widget. A RectObj resource also determines whether or not the gadget is sensitive.

    XmPrimitive

    XmPrimitive is the fundamental Motif class for all basic control widgets--widgets that do not have children. It includes the following resources and behavior:

    1. Foreground color, top and bottom shadow colors or pixmaps, and shadow thickness

    2. Thickness and color or pixmap for the highlighting rectangle, which is displayed when the widget has keyboard focus

    3. Resources to determine whether the user can traverse to the widget and whether or not it is a tab group

    4. A resource to determine what unit of measurement the widget uses for size and position resources

    5. Callbacks for the widget to invoke when the user presses osfHelp

    6. A resource for the application to use in associating arbitrary data with the widget

    7. Translations and actions for keyboard traversal to another widget

    8. A resource that specifies the direction in which components of the primitive (including strings) are laid out.

    9. Callbacks that allow the application to control which popup menu will be automatically posted.

    10. XmGadget

      XmGadget is the fundamental Motif class for all basic control gadgets. XmGadget is equivalent to XmPrimitive, with two major exceptions:

      1. It has no associated window.

      2. It has no translations or actions. The Manager parent controls traversal between its gadget children, keeps track of gadgets that have input focus, and dispatches events to them.

      3. [ Previous | Next | Contents | Glossary | Home | Search ]