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



Frame

Frame is a simple manager that encloses a child and displays a shadow around it. An application usually uses a Frame to provide a shadow for a widget, such as a RowColumn WorkArea, that does not display a shadow itself. The Frame resource XmNshadowType determines the type of shadow to draw. The resources XmNmarginHeight and XmNmarginWidth specify the margin between the shadow and the border of the child.

Frame can also have one other child that serves as a title. Frame places the title above the principal child of the Frame. The following constraint resources determine the Frame's treatment of the child:

XmNframeChildType

The value is a constant that tells the Frame whether the child is the work area child, the title, or another kind of child. Following are the possible values:

XmFRAME_WORKAREA_CHILD

This value specifies that the child is the principal (work area) component. This is the default.

XmFRAME_TITLE_CHILD

This value specifies that the child is the Frame title.

XmFRAME_GENERIC_CHILD

This value specifies that the child is a component other than the work area and the title. When the value is XmFRAME_GENERIC_CHILD, Frame does not include the child in its layout.

XmNchildHorizontalAlignment

The value specifies the alignment of the title with respect to the left and right inner edges of the Frame (determined by the child's XmNchildHorizontalSpacing). Following are the possible values:

XmALIGNMENT_BEGINNING

This value specifies that the title is placed at the left inner edge when the Frame's XmNstringDirection has the value XmSTRING_DIRECTION_L_TO_R; otherwise, the title is placed at the right inner edge. This is the default.

XmALIGNMENT_END

This value specifies that the title is placed at the right inner edge when the Frame's XmNstringDirection has the value XmSTRING_DIRECTION_L_TO_R; otherwise, the title is placed at the left inner edge.

XmALIGNMENT_CENTER

This value specifies that the title is centered between the edges.

XmNchildHorizontalSpacing

The value is the minimum distance between the title and the shadow along the left and right edges of the Frame. The default is the Frame's XmNmarginWidth.

XmNchildVerticalAlignment

The value specifies the alignment of the title with respect to the shadow along the top edge of the Frame. Following are the possible values:

XmALIGNMENT_BASELINE_BOTTOM

The baseline of the last line of text in the title is even with the shadow along the top edge of the Frame.

XmALIGNMENT_BASELINE_TOP

The baseline of the first line of text in the title is even with the shadow along the top edge of the Frame.

XmALIGNMENT_CENTER

The center of the title is even with the shadow along the top edge of the Frame. This is the default.

XmALIGNMENT_WIDGET_BOTTOM

The bottom edge of the title is even with the shadow along the top edge of the Frame.

XmALIGNMENT_WIDGET_TOP

The top edge of the title is even with the shadow along the top edge of the Frame.

Following is a UIL specification for an example Frame with a Label title and a Form child (not defined here):

object exampleFrame: XmFrame {
  controls {
      XmLabel  { arguments {
          XmNframeChildType = XmFRAME_TITLE_CHILD;
          XmNchildHorizontalSpacing = 4;
          XmNchildVerticalAlignment = XmALIGNMENT_WIDGET_BOTTOM;
        }; };
        XmForm exampleForm;
    };
};


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