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



Overview

Your widget needs to manage geometry when it encounters any of the following situations:

  1. Your widget is initially realized.

  2. An application calls XtSetValues to change one of the geometry resources in your widget.

  3. The user resizes a shell containing one of your widgets.

  4. An application resizes one of the parents of your widget.

  5. An application resizes one of the children managed by your widget.

    In addition to these typical cases, an application may also generate a geometry request by calling one of the Xt geometry management routines. Most of these routines require a response from your widget.

    The Intrinsics provide the five geometry resources shown in the following table. The Intrinsics monitor the values of these resources in a variety of ways. For example, the XtSetValues call automatically monitors the five geometry resources and takes certain actions when they change.

    Table 23. Geometry Resources of Core

    Field Resource Meaning
    core.border_width XmNborderWidth Specifies the width of the border that surrounds the widget's window on all four sides. The width is specified in pixels. A width of 0 means that no border shows.
    core.height XmNheight Specifies the inside height (excluding the border) of the widget's window.
    core.width XmNwidth Specifies the inside width (excluding the border) of the widget's window.
    core.x XmNx Specifies the x-coordinate of the upper-left outside corner of the widget's window. The value is relative to the upper-left inside corner of the parent's window.
    core.y XmNy Specifies the y-coordinate of the upper-left outside corner of the widget's window. The value is relative to the upper-left inside corner of the parent's window.

    The following seven Core class methods handle most of the work of geometry management:

    1. change_managed (of the parent widget)

    2. geometry_manager (of the parent widget)

    3. initialize (of the child widget)

    4. set_values (of the child widget)

    5. set_values_almost (of the child widget)

    6. resize (of the child widget)

    7. query_geometry (of the child widget)

      Each of these methods is examined in the following subsections.


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