Bwidget Source Code
Artifact Content
Not logged in

Artifact 018040da782fb27b6a446d76bd27ab42002d7441:


<HTML>
<HEAD><TITLE>Tree</TITLE></HEAD>
<BODY BGCOLOR=white>
<DL><DT><I><A HREF="#descr">NAME</A></I></DT>
<DD><B>Tree</B>
 - Tree widget
</DD></DL>
<DL>
<DT><I>CREATION</I></DT>
<DD><A HREF="#descr"><B>Tree</B></A> <I>pathName</I> ?<I>option value...</I>?</DD>
</DL>
<DL>
<DT><I>STANDARD OPTIONS</I></DT>
<DD><TABLE CELLSPACING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-background">-background or -bg</A></TD>
<TD>&nbsp;&nbsp;<A HREF="options.htm#M-borderwidth">-borderwidth or -bd</A></TD>
</TR>
<TR>
    <TD>&nbsp;&nbsp;<A HREF="options.htm#M-cursor">-cursor</A></TD>
    <TD>&nbsp;&nbsp;<A HREF="options.htm#M-highlightbackground">-highlightbackground</A></TD>
</TR>
<TR>
    <TD>&nbsp;&nbsp;<A HREF="options.htm#M-highlightcolor">-highlightcolor</A></TD>
    <TD>&nbsp;&nbsp;<A HREF="options.htm#M-highlightthickness">-highlightthickness</A></TD>
</TR>
<TR>
    <TD>&nbsp;&nbsp;<A HREF="options.htm#M-relief">-relief</A></TD>
    <TD>&nbsp;&nbsp;<A HREF="options.htm#M-selectbackground">-selectbackground</A></TD>
</TR>
<TR>
    <TD>&nbsp;&nbsp;<A HREF="options.htm#M-selectforeground">-selectforeground</A></TD>
    <TD>&nbsp;&nbsp;<A HREF="options.htm#M-takefocus">-takefocus</A></TD>
</TR>
<TR>
    <TD>&nbsp;&nbsp;<A HREF="options.htm#M-xscrollcommand">-xscrollcommand</A></TD>
    <TD>&nbsp;&nbsp;<A HREF="options.htm#M-yscrollcommand">-yscrollcommand</A></TD>
</TR>
</TABLE></DD>
</DL>
<DL>
<DT><I><A HREF="#wso">WIDGET-SPECIFIC OPTIONS</A></I></DT>
<DD><TABLE CELLSPACING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-closecmd">-closecmd</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-crossfill">-crossfill</A></TD>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-crossclosebitmap">-crossclosebitmap</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-crosscloseimage">-crosscloseimage</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-crossopenbitmap">-crossopenbitmap</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-crossopenimage">-crossopenimage</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-deltax">-deltax</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-deltay">-deltay</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-dragenabled">-dragenabled</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-dragendcmd">-dragendcmd</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-dragevent">-dragevent</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-draginitcmd">-draginitcmd</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-dragtype">-dragtype</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-dropcmd">-dropcmd</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-dropenabled">-dropenabled</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-dropovercmd">-dropovercmd</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-dropovermode">-dropovermode</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-droptypes">-droptypes</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-height">-height</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-linesfill">-linesfill</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-linestipple">-linestipple</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-opencmd">-opencmd</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-padx">-padx</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-redraw">-redraw</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-selectcommand">-selectcommand</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-selectfill">-selectfill</A></TD>
</TR>
<TR>
<TD>&nbsp;&nbsp;<A HREF="#-showlines">-showlines</A></TD>
<TD>&nbsp;&nbsp;<A HREF="#-width">-width</A></TD>
</TR>
</TABLE></DD>
</DL>

<DL>
<DT><I><A HREF="#wc">WIDGET COMMAND</A></I></DT>
<DD><I>pathName</I> <A HREF="#bindArea"><B>bindArea</B></A>
 <I>event</I>
 <I>script</I>
</DD>
<DD><I>pathName</I> <A HREF="#bindImage"><B>bindImage</B></A>
 <I>event</I>
 <I>script</I>
</DD>
<DD><I>pathName</I> <A HREF="#bindText"><B>bindText</B></A>
 <I>event</I>
 <I>script</I>
</DD>
<DD><I>pathName</I> <A HREF="#cget"><B>cget</B></A>
 <I>option</I>
</DD>
<DD><I>pathName</I> <A HREF="#closetree"><B>closetree</B></A>
 <I>node</I>
</DD>
<DD><I>pathName</I> <A HREF="#configure"><B>configure</B></A>
 ?<I>option</I>? ?<I>value</I> <I>option</I> <I>value</I> ...?
</DD>
<DD><I>pathName</I> <A HREF="#delete"><B>delete</B></A>
 ?<I>arg...</I>?
</DD>
<DD><I>pathName</I> <A HREF="#edit"><B>edit</B></A>
 <I>node</I>
 <I>text</I>
 ?<I>verifycmd</I>?
 ?<I>clickres</I>?
 ?<I>select</I>?
</DD>
<DD><I>pathName</I> <A HREF="#exists"><B>exists</B></A>
 <I>node</I>
</DD>
<DD><I>pathName</I> <A HREF="#find"><B>find</B></A>
 <I>findinfo</I>
 ?<I>confine</I>?
</DD>
<DD><I>pathName</I> <A HREF="#index"><B>index</B></A>
 <I>node</I>
</DD>
<DD><I>pathName</I> <A HREF="#insert"><B>insert</B></A>
 <I>index</I>
 <I>parent</I>
 <I>node</I>
 ?<I>option value...</I>?
</DD>
<DD><I>pathName</I> <A HREF="#itemcget"><B>itemcget</B></A>
 <I>node</I>
 <I>option</I>
</DD>
<DD><I>pathName</I> <A HREF="#itemconfigure"><B>itemconfigure</B></A>
 <I>node</I>
 ?<I>option</I>? ?<I>value</I> <I>option</I> <I>value</I> ...?
</DD>
<DD><I>pathName</I> <A HREF="#line"><B>line</B></A>
 <I>node</I>
</DD>
<DD><I>pathName</I> <A HREF="#move"><B>move</B></A>
 <I>parent</I>
 <I>node</I>
 <I>index</I>
</DD>
<DD><I>pathName</I> <A HREF="#nodes"><B>nodes</B></A>
 <I>node</I>
 ?<I>first</I>?
 ?<I>last</I>?
</DD>
<DD><I>pathName</I> <A HREF="#opentree"><B>opentree</B></A>
 <I>node</I>
</DD>
<DD><I>pathName</I> <A HREF="#parent"><B>parent</B></A>
 <I>node</I>
</DD>
<DD><I>pathName</I> <A HREF="#reorder"><B>reorder</B></A>
 <I>node</I>
 <I>neworder</I>
</DD>
<DD><I>pathName</I> <A HREF="#see"><B>see</B></A>
 <I>node</I>
</DD>
<DD><I>pathName</I> <A HREF="#selection"><B>selection</B></A>
 <I>cmd</I>
 ?<I>arg...</I>?
</DD>
<DD><I>pathName</I> <A HREF="#toggle"><B>toggle</B></A>
 <I>node</I>
</DD>
<DD><I>pathName</I> <A HREF="#visible"><B>visible</B></A>
 <I>node</I>
</DD>
<DD><I>pathName</I> <A HREF="#xview"><B>xview</B></A>
 ?<I>arg...</I>?
</DD>
<DD><I>pathName</I> <A HREF="#yview"><B>yview</B></A>
 ?<I>arg...</I>?
</DD>
</DL>
<BR><HR WIDTH="100%"><BR>
<B><A NAME="descr"></A>DESCRIPTION</B><BR>
<P>

<B>Tree</B> widget uses canvas to display a hierarchical list of items (called nodes).
Each node is composed of a label with its own font and foreground attributes, and an optional
image or window. Each node can have a list of subnodes, which can be collapsed or expanded.
Each node is drawn in a single line, whose height is defined by the
<B>deltay</B> option, so they must have at most this height.
A node is uniquely identified by a string given at creation (by the
<B>insert</B> command). The node named <I>root</I> is the root of
the tree and is not drawn.
The tree structure is directly maintained by the widget.

</P>
<BR><HR WIDTH="50%"><BR>
<B><A NAME="wso">WIDGET-SPECIFIC OPTIONS</A></B><BR>
<DL><DT><A NAME="-closecmd"><B>-closecmd</B></A></DT>
<DD>

Specifies a command to be called when user close a node. The
closed node is appended to the command.

</DD>
</DL>

<DL>
    <DT><A NAME="-crossfill"><B>-crossfill</B></A></DT>
    <DD>
    Specifies a foreground color for the cross bitmap.
    </DD>
</DL>

<DL><DT><A NAME="-crossclosebitmap"><B>-crossclosebitmap</B></A></DT>
<DD>
    Specifies a bitmap to be displayed in place of the standard cross
    when a node is closed.
</DD>
</DL>

<DL><DT><A NAME="-crosscloseimage"><B>-crosscloseimage</B></A></DT>
<DD>
    Specifies an image to be displayed in place of the standard cross
    when a node is closed.  Overrides the -crossclosebitmap option.
</DD>
</DL>

<DL><DT><A NAME="-crossopenbitmap"><B>-crossopenbitmap</B></A></DT>
<DD>
    Specifies a bitmap to be displayed in place of the standard cross
    when a node is open.
</DD>
</DL>

<DL><DT><A NAME="-crossopenimage"><B>-crossopenimage</B></A></DT>
<DD>
    Specifies an image to be displayed in place of the standard cross
    when a node is open.  Overrides the -crossopenbitmap option.
</DD>
</DL>

<DL><DT><A NAME="-deltax"><B>-deltax</B></A></DT>
<DD>

Specifies horizontal indentation between a node and its children.

</DD>
</DL>
<DL><DT><A NAME="-deltay"><B>-deltay</B></A></DT>
<DD>

Specifies vertical size of the nodes.

</DD>
</DL>
<DL><DT><A NAME="-dragenabled"><B>-dragenabled</B></A></DT>
<DD>
A boolean specifying if drag is enabled.
</DD>
</DL>
<DL><DT><A NAME="-dragendcmd"><B>-dragendcmd</B></A></DT>
<DD>

Specifies a command to be called when drag ended.
<B>dragendcmd</B> must be a command conforming to the description of the
option <B>dragendcmd</B> of <B>DragSite::<A HREF="DragSite.html#register">register</A></B>.

</DD>
</DL>
<DL><DT><A NAME="-dragevent"><B>-dragevent</B></A></DT>
<DD>

Specifies the number of the mouse button associated to the drag.
Must be <B>1</B>, <B>2</B> or <B>3</B>.

</DD>
</DL>
<DL><DT><A NAME="-draginitcmd"><B>-draginitcmd</B></A></DT>
<DD>

Tree has a command wrapper for <I>drag-init</I> events. This command refused the drag
if no node is designated. In other cases:
<BR>If <B>draginitcmd</B> is empty, it returns:
<UL>
<LI>the value of option <B>dragtype</B> or <I>TREE_NODE</I> if empty as the data type, 
<LI><I>{copy move link}</I> as the operations, 
<LI>the node identifier as the data.
</UL>
If <B>draginitcmd</B> is not empty, it is called with the following arguments:
<UL>
<LI>the pathname of the tree,
<LI>the identifier of the dragged node,
<LI>the toplevel created to represent dragged data.
</UL>
and must return a value conforming to <B>draginitcmd</B> option described in
<B>DragSite::<A HREF="DragSite.html#register">register</A></B>.

</DD>
</DL>
<DL><DT><A NAME="-dragtype"><B>-dragtype</B></A></DT>
<DD>

Specifies an alternate type of dragged object.

</DD>
</DL>
<DL><DT><A NAME="-dropcmd"><B>-dropcmd</B></A></DT>
<DD>

Tree has a command wrapper for <I>drop</I> events. This command stops auto scrolling
and extract node and position.
<BR>If <B>dropcmd</B> is not empty, it is called with the following arguments:
<UL>
<LI>the pathname of the tree,
<LI>the pathname of the drag source,
<LI>a list describing where the drop occurs. It can be:
<UL>
<LI><I>{</I><B>widget</B><I>}</I>,
<LI><I>{</I><B>node</B> <I>node}</I> or
<LI><I>{</I><B>position</B> <I>node index}</I>.
</UL>
<LI>the current operation,
<LI>the data type,
<LI>the data.
</UL>


</DD>
</DL>
<DL><DT><A NAME="-dropenabled"><B>-dropenabled</B></A></DT>
<DD>
A boolean specifying if drop is enabled.
</DD>
</DL>
<DL><DT><A NAME="-dropovercmd"><B>-dropovercmd</B></A></DT>
<DD>

Tree has a command wrapper for <I>drag-over</I> events. This command enables auto scrolling
and position extraction during the <I>drag-over</I>.
If <B>dropovercmd</B> is not empty, the command is called with the following aguments:
<UL>
<LI>the pathname of the tree,
<LI>the pathname of the drag source,
<LI>a list describing where the drop can occur, whose elements are:
<UL>
<LI>the string <I>widget</I> if <B>dropovertype</B> option contains <I>w</I>, else empty string.
<LI>the targeted node if drag icon points a node and <B>dropovertype</B> option contains <I>n</I>, else empty string.
<LI>a list containing a node and the position within the children of the node where drag 
icon points to if <B>dropovertype</B> option contains <I>p</I>, else empty string.
<LI>optionally, the preferred method if drop can occur both inside a node and between two
nodes. The value is <I>position</I> or <I>node</I>.
</UL>
<LI>the current operation,
<LI>the data type,
<LI>the data.
</UL>
The command must return a list with two elements:
<UL>
<LI>the drop status, conforming to those described in <B>dropovercmd</B> option of
<B>DropSite::<A HREF="DropSite.html#register">register</A></B>,
<LI>the choosen method: <I>widget</I>, <I>node</I> or <I>position</I>.
</UL>

</DD>
</DL>
<DL><DT><A NAME="-dropovermode"><B>-dropovermode</B></A></DT>
<DD>

Specifies the type of <I>drop-over</I> interaction. Must be a combination of
<B>w</B>, which specifies that drop can occurs everywhere on widget,
<B>p</B>, which specifies that drop can occurs between two nodes,
and <B>n</B>, which specifies that drop occurs inside nodes.

</DD>
</DL>
<DL><DT><A NAME="-droptypes"><B>-droptypes</B></A></DT>
<DD>

Specifies a list of accepted dropped object/operation.
See option <B>droptypes</B> of
<B>DropSite::<A HREF="DropSite.html#register">register</A></B>.
for more infromation.

<BR>Default is <I>TREE_NODE</I> with operations <B>copy</B> and <B>move</B>.

</DD>
</DL>
<DL><DT><A NAME="-height"><B>-height</B></A></DT>
<DD>

Specifies the desired height for the tree in units of <B>deltay</B> pixels.

</DD>
</DL>
<DL><DT><A NAME="-linesfill"><B>-linesfill</B></A></DT>
<DD>

Specifies a foreground color for the lines between nodes.

</DD>
</DL>
<DL><DT><A NAME="-linestipple"><B>-linestipple</B></A></DT>
<DD>

Specifies a stipple bitmap for the lines between nodes.

</DD>
</DL>
<DL><DT><A NAME="-opencmd"><B>-opencmd</B></A></DT>
<DD>

Specifies a command to be called when the user opens a node. The name
of the opened node is appended to the command.

</DD>
</DL>
<DL><DT><A NAME="-padx"><B>-padx</B></A></DT>
<DD>

Specifies distance between image or window and text of the nodes.

</DD>
</DL>
<DL><DT><A NAME="-redraw"><B>-redraw</B></A></DT>
<DD>

Specifies wether or not the tree should be redrawn when entering idle.
Set it to false if you call <B>update</B> while modifying the tree.

</DD>
</DL>
<DL><DT><A NAME="-selectcommand"><B>-selectcommand</B></A></DT>
<DD>

Specifies a command to be called when the selection is changed. The
path of the tree widget and the selected nodes are appended to the
command.

</DD>
</DL>

<DL><DT><A NAME="-selectfill"><B>-selectfill</B></A></DT>
<DD>
    If true, the selection box will be drawn across the entire tree from
    left-to-right instead of just around the item text.
</DD>
</DL>

<DL><DT><A NAME="-showlines"><B>-showlines</B></A></DT>
<DD>

Specifies whether or not lines should be drawn between nodes.

</DD>
</DL>
<DL><DT><A NAME="-width"><B>-width</B></A></DT>
<DD>

Specifies the desired width for the tree in units of 8 pixels.

</DD>
</DL>
<HR WIDTH="50%"><BR>

<B><A NAME="nodes">NODE NAMES</A></B><BR>
<p>
Certain special characters in node names are automatically substituted
by the tree during operation.  These characters are <b>&amp; | ^ !</b>.
They are all substituted with a <b>_</b> character.  This is only to
avoid errors because the characters are special to the tree widget.
</p>

<B><A NAME="wc">WIDGET COMMAND</A></B><BR>
<DL><DT><A NAME="bindArea"><I>pathName</I> <B>bindArea</B></A>
 <I>event</I>
 <I>script</I>
</DT><DD>

This command associates a command to execute whenever the event
sequence given by <I>event</I> occurs anywhere within the Tree area.
</DD></DL>
<DL><DT><A NAME="bindImage"><I>pathName</I> <B>bindImage</B></A>
 <I>event</I>
 <I>script</I>
</DT><DD>

This command associates a command to execute whenever the event
sequence given by <I>event</I> occurs on the image of a node.
The node idenfier on which the event occurs is appended to the command and may be used to manipulate the tree (e.g. don't use <B>%W</B>).

<P>
If <B>-selectfill</B> is given, an eventual binding of the background box by <B>bindText</B> is overwritten.
</P>
</DD></DL>
<DL><DT><A NAME="bindText"><I>pathName</I> <B>bindText</B></A>
 <I>event</I>
 <I>script</I>
</DT><DD>

This command associates a command to execute whenever the event
sequence given by <I>event</I> occurs on the label of a node.
The node idenfier on which the event occurs is appended to the command and may be used to manipulate the tree (e.g. don't use <B>%W</B>).

<P>
If <B>-selectfill</B> is given, an eventual binding of the background box by <B>bindImage</B> is overwritten.
</P>
</DD></DL>
<DL><DT><A NAME="cget"><I>pathName</I> <B>cget</B></A>
 <I>option</I>
</DT><DD>

Returns the current value of the configuration option given by <I>option</I>.
<I>Option</I> may have any of the values accepted by the creation command.
</DD></DL>
<DL><DT><A NAME="closetree"><I>pathName</I> <B>closetree</B></A> <I>node</I>
?<I>recurse</I>?
</DT><DD>

This command close all the subtree given by <I>node</I>. Recurse
through the tree starting at <I>node</I> and set <B>open</B> option to 0
depending on <I>recurse</I>. Default value of <I>recurse</I> is <I>true</I>.

</DD></DL>
<DL><DT><A NAME="configure"><I>pathName</I> <B>configure</B></A>
 ?<I>option</I>? ?<I>value</I> <I>option</I> <I>value</I> ...?
</DT><DD>

Query or modify the configuration options of the widget. If no <I>option</I> is
specified, returns a list describing all of the available options for
<I>pathName</I>.  If <I>option</I> is specified with no <I>value</I>, then the
command returns a list describing the one named <I>option</I> (this list will
be identical to the corresponding sublist of the value returned if no
<I>option</I> is specified). If one or more <I>option-value</I> pairs are
specified, then the command modifies the given widget option(s) to have the
given value(s); in this case the command returns an empty string.
<I>Option</I> may have any of the values accepted by the creation command.
Read-only options are not be modified.

</DD></DL>
<DL><DT><A NAME="delete"><I>pathName</I> <B>delete</B></A>
 ?<I>arg...</I>?
</DT><DD>

Deletes all nodes (and children of them) in <I>arg</I>. <I>arg</I> can be a list
of nodes or a list of list of nodes.
To delete all the tree, do <I>$pathName delete [$pathName nodes root]</I>.

</DD></DL>
<DL><DT><A NAME="edit"><I>pathName</I> <B>edit</B></A>
 <I>node</I>
 <I>text</I>
 ?<I>verifycmd</I>?
 ?<I>clickres</I>?
 ?<I>select</I>?
</DT><DD>

Provides a way for the user to edit in place the label of a node. This is
possible only if <I>node</I> is visible (all its parents are open).
<BR>The command takes the initial text as argument and does not modify the label of the
edited node, but returns an empty string if edition is canceled, or the typed text
if edition is accepted.
<BR>When editing, the user can cancel by pressing Escape, or accept by pressing Return.
<BR><I>clickres</I> specifies what to do if the user click outside the editable area.
If <I>clickres</I> is 0 (the default), the edition is canceled.
If <I>clickres</I> is 1, the edition is accepted.
In all other case, the edition continues.
<BR>If edition is accepted and <I>modifycmd</I> is not empty, then it is called with
the new text as argument and must return 1 to accept the new text, 0 to refuse it
and continue edition.
<BR><I>select</I> specifies wether or not the initial text should be selected. Default is 1.

</DD></DL>
<DL><DT><A NAME="exists"><I>pathName</I> <B>exists</B></A>
 <I>node</I>
</DT><DD>

Returns whether or not <I>node</I> exists in the tree.

</DD></DL>
<DL><DT><A NAME="find"><I>pathName</I> <B>find</B></A>
 <I>findinfo</I>
 ?<I>confine</I>?
</DT><DD>

<p>
Returns the node given by the position <I>findinfo</I>.
<I>findinfo</I> can take the form of a pixel position <I>@x,y</I> or
of the line number of a currently visible Tree node.  The first line
of the Tree has the value of zero.
</p>

<p>
If <I>confine</I> is non-empty, then confine <I>findinfo</I> to only
match pixel positions for the area consumed by Tree labels, not just
anywhere on their lines.  (<I>confine</I> has no effect if
<I>findinfo</I> is a line number.)
</p>

</DD></DL>
<DL><DT><A NAME="index"><I>pathName</I> <B>index</B></A>
 <I>node</I>
</DT><DD>

Returns the position of <I>node</I> in its parent.

</DD></DL>
<DL><DT><A NAME="insert"><I>pathName</I> <B>insert</B></A>
 <I>index</I>
 <I>parent</I>
 <I>node</I>
 ?<I>option value...</I>?
</DT><DD>

<p>
Inserts a new node identified by <I>node</I> in the children list of
<I>parent</I> at position <I>index</I>.
</p>

<p>
Any instance of <i>#auto</i> within the node name will be replaced by the
number of the item in the order of insertion.  The non-printable characters
\1 to \5 are reserved for internal use and should not be present in node
names.
</p>


<P>
<DL><DT><A NAME="Node-anchor"><B>-anchor</B></A></DT>
<DD>
    Specifies the anchor of the image or window of the node.  Defaults to w.
</DD>
</DL>

<DL><DT><A NAME="Node-data"><B>-data</B></A></DT>
<DD>

User data associated to the node.

</DD>
</DL>
<DL><DT><A NAME="-deltax"><B>-deltax</B></A></DT>
<DD>

Specifies the horizontal indentation of the node.  If the value is -1, the
node will be drawn with the deltax for the entire tree.

</DD>
</DL>
<DL><DT><A NAME="Node-drawcross"><B>-drawcross</B></A></DT>
<DD>

Specifies how the cross used to expand or collapse the children of a node
should be drawn. 
Must be one of <B>auto</B>, <B>always</B> or <B>never</B>.
<BR>If <B>auto</B>, the cross is drawn only if the node has children.
If <B>always</B>, the cross is always drawn.
If <B>never</B>, the cross is never drawn.
To maintain compatibility with older versions of this widget,
<B>allways</B> is a deprecated synonym to <B>always</B>.

</DD>
</DL>
<DL><DT><A NAME="Node-fill"><B>-fill</B></A></DT>
<DD>

Specifies the foreground color of the label of the node.

</DD>
</DL>
<DL><DT><A NAME="Node-font"><B>-font</B></A></DT>
<DD>

Specifies a font for the label of the node.

</DD>
</DL>
<DL><DT><A NAME="-helpcmd"><B>-helpcmd</B></A></DT>
<DD>

If specified, refers to a command to execute to get the help text to display.
The command must return a string to display.
If the command returns an empty string, no help is displayed. 
See also <A HREF="DynamicHelp.html">DynamicHelp</A>.
</DD>
</DL>
<DL><DT><A NAME="-helptext"><B>-helptext</B></A></DT>
<DD>

Text for dynamic help.
See also <A HREF="DynamicHelp.html">DynamicHelp</A>.
</DD>
</DL>
<DL><DT><A NAME="-helptype"><B>-helptype</B></A></DT>
<DD>
Type of dynamic help. Use <I>balloon</I> or <I>variable</I>.
See also <A HREF="DynamicHelp.html">DynamicHelp</A>.
</DD>
</DL>
<DL><DT><A NAME="-helpvar"><B>-helpvar</B></A></DT>
<DD>
Variable to use when <B>helptype</B> option is <I>variable</I>.
See also <A HREF="DynamicHelp.html">DynamicHelp</A>.
</DD>
</DL>
<DL><DT><A NAME="Node-image"><B>-image</B></A></DT>
<DD>

Specifies an image to display at the left of the label of the node.
<B>window</B> option override <B>image</B>.
</DD>
</DL>
<DL><DT><A NAME="Node-open"><B>-open</B></A></DT>
<DD>

Specifies wether or not the children of the node should be drawn.

</DD>
</DL>
<DL><DT><A NAME="-padx"><B>-padx</B></A></DT>
<DD>

Specifies the distance between image or window and the text of the node.  If
the value is -1, the node will be drawn with the padx for the entire tree.

</DD>
</DL>
<DL><DT><A NAME="Node-selectable"><B>-selectable</B></A></DT>
<DD>

Specifies if the node can be selected or not.

</DD>
</DL>
<DL><DT><A NAME="Node-text"><B>-text</B></A></DT>
<DD>

Specifies the label of the node.

</DD>
</DL>
<DL><DT><A NAME="Node-window"><B>-window</B></A></DT>
<DD>

Specifies a pathname to display at the left of the label of the node.
<B>window</B> option override <B>image</B>.
</DD>
</DL>
</DD></DL>
<DL><DT><A NAME="itemcget"><I>pathName</I> <B>itemcget</B></A>
 <I>node</I>
 <I>option</I>
</DT><DD>

Returns the current value of a configuration option for the item.
<I>Option</I> may have any of the values accepted by the item creation command.

</DD></DL>
<DL><DT><A NAME="itemconfigure"><I>pathName</I> <B>itemconfigure</B></A>
 <I>node</I>
 ?<I>option</I>? ?<I>value</I> <I>option</I> <I>value</I> ...?
</DT><DD>

This command is similar to the <B>configure</B> command, except that it applies to the
options for an individual item, whereas <B>configure</B> applies to the options for
the widget as a whole. <B>Options</B> may have any of the values accepted by the 
item creation widget command. If options are specified, options are modified as indicated
in the command and the command returns an empty string. If no options are specified,
returns a list describing the current options for the item.
Read-only options are not be modified.

</DD></DL>
<DL><DT><A NAME="line"><I>pathName</I> <B>line</B></A>
 <I>node</I>
</DT><DD>

<p>
Returns the line number where <I>node</I> was drawn.  If the node is
not visible then return -1.  The first line of the tree has the value
of 0.
</p>

</DD></DL>
<DL><DT><A NAME="move"><I>pathName</I> <B>move</B></A>
 <I>parent</I>
 <I>node</I>
 <I>index</I>
</DT><DD>

Moves <I>node</I> to the children list of <I>parent</I> at position <I>index</I>.
<I>parent</I> can not be a descendant of <I>node</I>.

</DD></DL>
<DL><DT><A NAME="nodes"><I>pathName</I> <B>nodes</B></A>
 <I>node</I>
 ?<I>first</I>?
 ?<I>last</I>?
</DT><DD>

Returns parts of the children of <I>node</I>, following <I>first</I> and <I>last</I>.<BR>
If <I>first</I> and <I>last</I> are omitted, returns the list of all children.
If <I>first</I> is specified and <I>last</I> omitted, returns the child at index
<I>first</I>, or an empty string if <I>first</I> refers to a non-existent element.
If <I>first</I> and <I>last</I> are specified, the command returns a list whose elements
are all of the children between <I>first</I> and <I>last</I>,
inclusive. Both <I>first</I> and <I>last</I> may have any of the standard
forms for indices.

</DD></DL>
<DL><DT><A NAME="opentree"><I>pathName</I> <B>opentree</B></A> <I>node</I> ?<I>recurse</I>?

</DT><DD>

This command open all the subtree given by <I>node</I>. Recurse through the
tree starting at <I>node</I> and set <B>open</B> option to 1 depending on value
of <I>recurse</I>. Default value of <I>recurse</I> is <I>true</I>.

</DD></DL>
<DL><DT><A NAME="parent"><I>pathName</I> <B>parent</B></A>
 <I>node</I>
</DT><DD>

Returns the parent of <I>node</I>.

</DD></DL>
<DL><DT><A NAME="reorder"><I>pathName</I> <B>reorder</B></A>
 <I>node</I>
 <I>neworder</I>
</DT><DD>

Modifies the order of children of <I>node</I> given by <I>neworder</I>. Children of
<I>node</I> that do not appear in <I>neworder</I> are no moved.

</DD></DL>
<DL><DT><A NAME="see"><I>pathName</I> <B>see</B></A>
 <I>node</I>
</DT><DD>

Arrange the scrolling area to make <I>node</I> visible.

</DD></DL>
<DL><DT><A NAME="selection"><I>pathName</I> <B>selection</B></A>
 <I>cmd</I>
 ?<I>arg...</I>?
</DT><DD>

Modifies the list of selected nodes following <I>cmd</I>:
<DL>
<DT><B>add</B>
<DD>Adds all nodes in <I>arg</I> to the selection.
<DT><B>clear</B>
<DD>Removes all nodes from the selection.
<DT><B>get</B>
<DD>Returns a list containing the indices of current selected nodes.
<DT><B>includes</B>
<DD>Tests if the specified node is selected. Returns true if the answer is yes, and false else.
<DT><B>range</B>
<DD>Sets the selection to all nodes between the two specified ones.
<DT><B>remove</B>
<DD>Removes all nodes in <I>arg</I> from the selection.
<DT><B>set</B>
<DD>Sets the selection to all nodes in <I>arg</I>.
<DT><B>toggle</B>
<DD>Toggles the selection status of all nodes in <I>arg</I>.
</DL>

The subcommands <B>add</B>, <B>range</B>, and <B>set</B> silently
ignore nodes which are declared unselectable. See the node option
<a href="#Node-selectable">-selectable</a> to influence this.

</DD></DL>

</DD></DL>

<DL><DT><A NAME="toggle"><I>pathName</I> <B>toggle</B></A>
 <I>node</I>
</DT><DD>
    Toggle the open/close status of the given <i>node</i>.
</DD></DL>

<DL><DT><A NAME="visible"><I>pathName</I> <B>visible</B></A>
 <I>node</I>
</DT><DD>

Returns whether or not <I>node</I> is visible (all its parents are open).

</DD></DL>
<DL><DT><A NAME="xview"><I>pathName</I> <B>xview</B></A>
 ?<I>arg...</I>?
</DT><DD>

Standard command to enable horizontal scrolling of <I>pathName</I>.

</DD></DL>
<DL><DT><A NAME="yview"><I>pathName</I> <B>yview</B></A>
 ?<I>arg...</I>?
</DT><DD>

Standard command to enable vertical scrolling of <I>pathName</I>.

</DD></DL>

<B><A NAME="nodes">BINDINGS</A></B><BR>

<p>
A <b>&lt;&lt;TreeSelect&gt;&gt;</b> virtual event is generated any time the
selection in the tree changes.  This is the default behavior of an
item in the tree, but it can be overridden with the bindText or
bindImage command.  If the button 1 binding is overridden, this event may
not be generated.
</p>

<p>
The tree has all the standard mouse wheel bindings when it has focus.
</p>

</BODY></HTML>