Form widget

The Form widget is a composite widget which lays out its children according to "attachments". An attachment specifies the position of a widget relative to another widget, or to the form itself.

The form widget retains the relative positions of widgets constrained by these attachments when it is resized. It also maintains the relative positions when any child is added, resized, or deleted.

WorkShop Visual has a Layout Editor which simplifies the task of setting up form and component widget attachments.

The Form widget is derived from a Bulletin Board widget, and as such shares the same resource panel.

For more information on the Form widget, you are referred to XmForm(3X) in the OSF/Motif Programmer's Reference.

HINTS

The order in which attachments are made in a form is significant. The form will sometime change an attachment in line with some notion of internal consistency.

If you are having trouble with form layout, try making the attachments in a different order, or try resetting the form.

The form has a very restrictive notion of "circularity of attachments": you cannot attach, for example, the top of widget A to the bottom of widget B, as well as attaching the top of widget B onto the bottom of widget A. There are other cases to consider; the WorkShop Visual Layout Editor prevents you from making some of these illegal attachments automatically.

Motif moves widgets around until either they satisfy any attachments specified, or an upper bound on the iterative movements is reached. Motif warns if any attachments could not be resolved.

In Motif by default, children of a form are attached by their top edge to the top of the parent form, and by their left edge to the left of the form. This behavior was undocumented.

See also: