1XmForm(3X)                                                          XmForm(3X)
2
3
4

NAME

6       XmTree - The Tree widget class
7

SYNOPSIS

9       #include <Xm/XTree.h>
10

DESCRIPTION

12       The Tree widget is a container that shows the relationship of its chil‐
13       dren in a graphical tree-like format. Each child of the Tree widget  is
14       a  node in the Tree. The parent-child relationships between these nodes
15       are completely distinct from the widget hierarch..   The  hierarchy  of
16       nodes is created by specifying the tree "parent" of each node as a con‐
17       straint resource. If a node's parent is NULL then it is assumed to be a
18       root  of  the  tree. Although each widget can only have one parent, the
19       Tree widget supports adding more than one "root" node to a single Tree.
20
21       Note: the Tree widget assumes that is will be totally  responsible  for
22       mapping  and  unmapping its children. Therefore no child of this widget
23       should ever modify its mappedWhenManaged resource. If a child does mod‐
24       ify this resource the behavior is undefined.
25

User Interaction

27       Each node in the tree can be in four states: open, closed, always open,
28       and hidden. The state of a node changes how it appears to the user  and
29       what actions are available to the user.
30
31       Open           This  node  will  have  an open folder shown to its left
32                      that may be selected by the user  to  close  this  node.
33                      When  a node is open all of its children will be visible
34                      to the user.
35
36
37       Closed         This node will have a closed folder shown  to  its  left
38                      that may be selected by the user to open this node. When
39                      a node is closed none of its children will be visible to
40                      the user.
41
42
43       Always Open    This node will have no folder button associated with it.
44                      All of its children will be visible to the user.
45
46
47       Hidden         This node will not be shown to the user and all  of  its
48                      children  will  appear  and  act exactly as if they were
49                      children of this node's parent. It will  appear  to  the
50                      user as if this node does not exist.
51
52       To  maintain consistency of the user interface we have found that it is
53       bestto use the node state "Always Open" for  nodes  with  no  children.
54       This way the user will only see a folder button next to a node that has
55       children to display. A folder button associated with a node that has no
56       children has no defined semantics.
57

Normal Resources

59       Name                  Class          Type                  Initial Value
60       connectStyle          ConnectStyle   unsigned char         XmTreeDirect
61       horizontalNodeSpace   Dimension      HorizontalDimension   20
62       verticalNodeSpace     Dimension      VerticalDimension     2
63
64       All  resource  names  begin with XmN and all resource class names begin
65       with XmC.
66

connectStyle

68       The style of the lines visually connecting  parent  nodes  to  children
69       nodes. The valid styles are XmTreeDirect or XmTreeLadder.
70

horizontalNodeSpace

verticalNodeSpace

73       The amount of space between each node in the tree and it nearest neigh‐
74       bor.
75
76       The following resources are inherited from the XmHierarchy widget:
77
78
79       Name                Class       Type                  Initial Value
80       autoClose           AutoClose   Boolean               True
81       closeFolderPixmap   Pixmap      Pixmap                XmUNSPECIFIED_PIXMAP
82       horizontalMargin    Dimension   HorizontalDimension   2
83       openFolderPixmap    Pixmap      Pixmap                XmUNSPECIFIED_PIXMAP
84       refigureMode        Boolean     Boolean               True
85       verticalMargin      Dimension   VerticalDimension     2
86
87       All resource names begin with XmN and all resource  class  names  begin
88       with XmC.
89

Constraint Resources

91       Name               Class              Type        Initial Value
92       openClosePadding   OpenClosePadding   Int         0
93       lineColor          Foreground         Pixel       <dynamic>
94       lineWidth          LineWidth          Dimension   0
95
96       All  resource  names  begin with XmN and all resource class names begin
97       with XmC.  openClosePadding
98
99       The number of pixels between the folder button and the node it is asso‐
100       ciated with.
101

lineColor

103       The  color  of  the  line  connecting a node to its parent. The default
104       value for this resource is the foreground color of the Tree widget.
105

lineWidth

107       The width of a connection line between a node and its parent
108
109       The following constraint resources are inherited from  the  XmHierarchy
110       widget:
111
112       Name           Class          Type                   Initial Value
113       insertBefore   InsertBefore   Widget                 NULL
114       nodeState      NodeState      XmHierarchyNodeState   Open
115       parentNode     ParentNode     Widget                 NULL
116
117       All  resource  names  begin with XmN and all resource class names begin
118       with XmC.  Geometry Management:
119
120       The layout is performed by assigning each node a box that is just large
121       enough  to con- tain itself and all of its children. A recursive layout
122       is then performed that centers each node vertically in its box  and  at
123       the  extreme left horizontally. The children's boxes are then placed to
124       the right of the node separated by the horizontalNodeSpace  from  their
125       parent,  stacked  above  each other and separated by verticalNodeSpace.
126       This process is repeated recursively for each child in the tree.
127
128       The preferred size of the entire tree will be just large enough to con‐
129       tain  all nodes in the hierarchy. As the state of nodes change the tree
130       will attempt to resize itself to con- tain its  current  configuration.
131       If  the  tree  is forced larger than the desired size the nodes will be
132       centered vertically and flush to the left edge of the tree  widget.  If
133       the  tree  is  forced smaller, some nodes may be moved or drawn outside
134       the end of the tree. For this reason it is usually desirable to put the
135       tree into a Scrolled Window widget.
136

SEE ALSO

138       XmColumn(3X)
139
141       Copyright (c) 1992 by Integrated Computer Solutions, Inc.
142
143
144
145                                 15 July 1992                       XmForm(3X)
Impressum