Blob Blame History Raw
.DT
.TH XmForm 3X "15 July 1992"
.SH NAME
XmTree - The Tree widget class
.SH SYNOPSIS
#include <Xm/XTree.h>
.SH DESCRIPTION
.PP
.TS
tab (%);
l l.
.TE
.PP
The Tree widget is a container that shows the relationship of its children in a graphical 
tree-like format. Each child of the Tree widget is a node in the Tree. The parent-child 
relationships between these nodes are completely distinct from the widget hierarch.. 
The hierarchy of nodes is created by specifying the tree "parent" of each node as a 
constraint resource. If a node's parent is NULL then it is assumed to be a root of the 
tree. Although each widget can only have one parent, the Tree widget supports adding 
more than one "root" node to a single Tree.
.PP
Note: the Tree widget assumes that is will be totally responsible for mapping and 
unmapping its children. Therefore no child of this widget should ever modify its 
mappedWhenManaged resource. If a child does modify this resource the behavior is 
undefined.
.PP
.SH User Interaction
.PP
Each node in the tree can be in four states: open, closed, always open, and hidden. The 
state of a node changes how it appears to the user and what actions are available to the 
user.
.ta 15
.HP 15
Open	This node will have an open folder shown to its left that 
may be selected by the user to close this node. When a 
node is open all of its children will be visible to the user.

.ta 15
.HP 15
Closed	This node will have a closed folder shown to its left that 
may be selected by the user to open this node. When a 
node is closed none of its children will be visible to the 
user.

.ta 15
.HP 15
Always Open	This node will have no folder button associated with it. 
All of its children will be visible to the user.

.ta 15
.HP 15
Hidden	This node will not be shown to the user and all of its 
children will appear and act exactly as if they were 
children of this node's parent. It will appear to the user 
as if this node does not exist.
.PP
To maintain consistency of the user interface we have found that it is bestto use the 
node state "Always Open" for nodes with no children. This way the user will only see 
a folder button next to a node that has children to display. A folder button associated 
with a node that has no children has no defined semantics.
.PP
.SH Normal Resources
.PP
.TS
tab (%);
l l l l.
Name%Class%Type%Initial Value
connectStyle%ConnectStyle%unsigned char%XmTreeDirect
horizontalNodeSpace%Dimension%HorizontalDimension%20
verticalNodeSpace%Dimension%VerticalDimension%2
.TE
.PP
All resource names begin with XmN and all resource class names begin with XmC.
.PP
.SH connectStyle
.PP
The style of the lines visually connecting parent nodes to children nodes. The valid styles are XmTreeDirect or XmTreeLadder.
.SH horizontalNodeSpace
.PP
.SH verticalNodeSpace
.PP
The amount of space between each node in the tree and it nearest neighbor.

The following resources are inherited from the XmHierarchy widget:

.TS
tab (%);
l l l l.
Name%Class%Type%Initial Value
autoClose%AutoClose%Boolean%True
closeFolderPixmap%Pixmap%Pixmap%XmUNSPECIFIED_PIXMAP
horizontalMargin%Dimension%HorizontalDimension%2
openFolderPixmap%Pixmap%Pixmap%XmUNSPECIFIED_PIXMAP
refigureMode%Boolean%Boolean%True
verticalMargin%Dimension%VerticalDimension%2
.TE
.PP
All resource names begin with XmN and all resource class names begin with XmC.
.PP
.SH Constraint Resources
.PP 
.TS
tab (%);
l l l l.
Name%Class%Type%Initial Value
openClosePadding%OpenClosePadding%Int%0
lineColor%Foreground%Pixel%<dynamic>
lineWidth%LineWidth%Dimension%0
.TE
.PP
All resource names begin with XmN and all resource class names begin with XmC.
openClosePadding
.PP
The number of pixels between the folder button and the node it is associated with.
.PP
.SH lineColor
.PP 
The color of the line connecting a node to its parent. The default value for this 
resource is the foreground color of the Tree widget.
.PP
.SH lineWidth
.PP
The width of a connection line between a node and its parent
.PP 
The following constraint resources are inherited from the XmHierarchy widget:
.PP
.TS
tab (%);
l l l l.
Name%Class%Type%Initial Value
insertBefore%InsertBefore%Widget%NULL
nodeState%NodeState%XmHierarchyNodeState%Open
parentNode%ParentNode%Widget%NULL
.TE
.PP
All resource names begin with XmN and all resource class names begin with XmC.
Geometry Management:
.PP
The layout is performed by assigning each node a box that is just large enough to con-
tain itself and all of its children. A recursive layout is then performed that centers each 
node vertically in its box and at the extreme left horizontally. The children's boxes are 
then placed to the right of the node separated by the horizontalNodeSpace from their 
parent, stacked above each other and separated by verticalNodeSpace. This process is 
repeated recursively for each child in the tree.
.PP
The preferred size of the entire tree will be just large enough to contain all nodes in 
the hierarchy. As the state of nodes change the tree will attempt to resize itself to con-
tain its current configuration. If the tree is forced larger than the desired size the nodes 
will be centered vertically and flush to the left edge of the tree widget. If the tree is 
forced smaller, some nodes may be moved or drawn outside the end of the tree. For 
this reason it is usually desirable to put the tree into a Scrolled Window  
widget.
.PP
.SH SEE ALSO
.PP
XmColumn(3X)
.PP
.SH COPYRIGHT
.PP
Copyright (c) 1992 by Integrated Computer Solutions, Inc.