Application Header file | <Xraw/Tree.h> |
---|---|
Class Header file | <Xraw/TreeP.h> |
Class | treeWidgetClass |
Class Name | Tree |
Superclass | Container --> Constraint --> Composit --> Core |
The Tree widget provides geometry management of arbitrary widgets arranged in a directed, acyclic graph (i.e., a tree). The hierarchy is contructed by attaching a constraint resource called treeParent to each widget indicating which other node in the tree should be treated as the widget's superior. The structure of the tree is shown by laying out the nodes in the standard format for tree diagrams with lines drawn connecting each node with its children.
The Tree sizes itself according to the needs of its children and is not intended to be resized by its parent. Instead, it should be placed inside another composite widget (such as the Porthole or Viewport) that can be used to scroll around in the tree.
Name | Class | Type | Notes | Default Value |
---|---|---|---|---|
autoReconfigure | AutoReconfigure | Boolean | False | |
gravity | Gravity | XtGravity | WestGravity | |
hSpace | HSpace | Dimension | 4 | |
lineWidth | LineWidth | Dimension | 0 | |
vSpace | VSpace | Dimension | 4 |
autoReconfigure | Whether or not to layout the tree every time a node is added or removed. |
---|---|
gravity | Specifies the side of the widget from which the tree should grow. Valid values include WestGravity, NorthGravity, EastGravity, and SouthGravity. |
hSpace |   |
vSpace | The amount of space, in pixels, to leave between the children. This resource specifies the amount of space left between the outermost children and the edge of the box. |
lineWidth | The width of the lines from nodes that do not have a treeGC constraint resource to their children. |
Each child of the Tree widget must specify its superior node in the tree. In addition, it may specify a GC to use when drawing a line between it and its inferior nodes.
Name | Class | Type | Notes | Default Value |
---|---|---|---|---|
treeGC | TreeGC | GC | NULL | |
treeParent | TreeParent | Widget | NULL |
treeGC | This specifies the GC to use when drawing lines between this widget and its inferiors in the tree. If this resource is not specified, the Tree's foreground and lineWidth will be used. |
---|---|
treeParent | This specifies the superior node in the tree for this widget. The default is for the node to have no superior (and to therefore be at the top of the tree). |
After positioning all children, the Tree widget attempts to shrink its own size to the minimum dimensions required for the layout.
The most efficient way to layout a tree is to set
to False and then use the
routine to arrange the children.
void XawTreeForceLayout(w)
Widget w;
w | Specifies the Tree widget. |