NAME
Box widget − geometry-managing box widget.
SYNOPSIS
Public Headers:<X11/StringDefs.h> <X11/Xaw/Box.h>
Private Header:<X11/Xaw/BoxP.h>
Class Name:Box
Class Pointer:boxWidgetClass
Instantiation:widget = XtCreateWidget(name, boxWidgetClass, ...)
CLASS HIERARCHY
Core → Composite → Box
DESCRIPTION
The Box widget provides geometry management of arbitrary widgets in a box of a specified dimension. Box moves but does not resize its children. The children are rearranged when the Box is resized, when its children are resized, or when children are managed or unmanaged. The Box widget always attempts to pack its children as closely as possible within the geometry allowed by its parent.
Box widgets are commonly used to manage a related set of Command widgets and are frequently called ButtonBox widgets, but the children are not limited to buttons.
The children are arranged on a background that has its own specified dimensions and color.
RESOURCES
When creating a Box widget instance, the following resources are retrieved from the argument list or from the resource database:
| Name (XtN...) | Type | Default | Description | |||
| XtNaccelerators | AcceleratorTable | NULL | List of event-to-action bindings to be executed by this widget, even though the event occurred in another widget. | |||
| XtNancestor− Sensitive |
Boolean | True | (D) Sensitivity state of the ancestors of this widget: a widget is insensitive if either it or any of its ancestors is insensitive. | |||
| XtNbackground | Pixel | XtDefault− Background |
Window background color. | |||
| XtNbackground− Pixmap |
Pixmap | XtUnspecified− Pixmap |
Window background pixmap. | |||
| XtNborderColor | Pixel | XtDefault− Foreground |
Window border color. | |||
| XtNborderPixmap | Pixmap | XtUnspecified− Pixmap |
Window border pixmap. | |||
| XtNborderWidth | Dimension | 1 | Border width on button box. | |||
| XtNchildren | WidgetList | NULL | (R) List of all this composite widget’s current children. | |||
| XtNcolormap | Colormap | Parent’s colormap. | Colormap that this widget will use. | |||
| XtNdepth | int | Parent’s depth. | (C) Depth of this widget’s window. | |||
| XtNdestroy− Callback |
XtCallbackList | NULL | Callbacks for XtDestroyWidget(). | |||
| XtNheight | Dimension | See below. | (A) Viewing height of inner window. | |||
| XtNhSpace | Dimension | 4 | Pixel distance left and right of children. | |||
| XtNmappedWhen− Managed |
Boolean | TRUE | Whether XtMapWidget() is automatic. | |||
| XtNnumChildren | Cardinal | 0 | (R) Number of children in this composite widget. | |||
| XtNorientation | Orientation | XtOrientVertical | See below. | |||
| XtNscreen | Screen | Parent’s screen. | (R) Screen on which this widget is displayed. | |||
| XtNsensitive | Boolean | TRUE | Whether widget receives input. | |||
| XtNtranslations | TranslationTable | NULL | Event-to-action translations. | |||
| XtNvSpace | Dimension | 4 | Pixel distance top and bottom of children. | |||
| XtNwidth | Dimension | See below. | (A) Viewing width of inner window. | |||
| XtNx | Position | 0 | x coordinate in pixels. | |||
| XtNy | Position | 0 | y coordinate in pixels. | |||
The Box widget positions its children in rows with XtNhSpace pixels to the left and right of each child and XtNvSpace pixels between rows. If the Box width is not specified, the Box widget uses the width of the widest child. Each time a child is managed or unmanaged, the Box widget attempts to reposition the remaining children to compact the box. Children are positioned in order, from left to right and from top to bottom. The packing algorithm used depends on the value of XtNorientation, which is described below. After positioning all children, the Box widget attempts to shrink its own size to the minimum dimensions required for the layout.
The XtNorientation resource specifies whether the preferred shape of the box (i.e., the result returned by the query_geometry() class method) is tall and narrow (XtOrientVertical) or short and wide (XtOrientHorizontal). When the Box is a child of a parent which enforces width constraints, it is usually better to specify XtOrientVertical (the default). When the parent enforces height constraints, it is usually better to specify XtOrientHorizontal.
The packing algorithm used by the Box widget depends on the value of XtNorientation. The two possibilities are:
XtOrientVertical
When the next child does not fit on the current row, a new row is started. If a child is wider than the width of the box, the box will request a larger width from its parent and will begin the layout process from the beginning if a new width is granted.
XtOrientHorizontal
When the next child does not fit in the current column, a new column is started. If a child is taller than the height of the box, the box will request a larger height from its parent and will begin the layout process from the beginning if a new height is granted.
SEE ALSO
CompositeUNIX SYSTEM V/68 and V/88 Release 4, CoreUNIX SYSTEM V/68 and V/88 Release 4,
Command.