Sophie

Sophie

distrib > Mageia > 6 > armv5tl > by-pkgid > 346faae07f6a43f8475eca2d60a9a449 > files > 194

blt-2.5-12.mga6.armv5tl.rpm

                                                                      
                                   <!-- manual page source format generated by PolyglotMan v3.0.9, -->
<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->

<HTML>
<HEAD>
<TITLE>Blt_TreeCreateNode(3) manual page</TITLE>
</HEAD>
<BODY bgcolor=white>
<A HREF="#toc">Table of Contents</A><P>

<H2><A NAME="sect0" HREF="#toc0">Name</A></H2>
Blt_TreeCreateNode - Creates a node
in a tree data object. 
<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2>
<BR>
<PRE>#include &lt;bltTree.h&gt;

Blt_TreeNode
Blt_TreeCreateNode(tree, parent, name, position)
</PRE>
<H2><A NAME="sect2" HREF="#toc2">Arguments</A></H2>
<P>
Blt_Tree   <I>tree</I><tt> </tt>&nbsp;<tt> </tt>&nbsp;(in)<BR>
<tt> </tt>&nbsp;<tt> </tt>&nbsp;Tree containing the parent node. <P>
Blt_TreeNode   <I>parent</I><tt> </tt>&nbsp;<tt> </tt>&nbsp;(in)<BR>
<tt> </tt>&nbsp;<tt> </tt>&nbsp;Node in which to insert the new child. <P>
const char   <I>*name</I><tt> </tt>&nbsp;<tt> </tt>&nbsp;(in)<BR>
<tt> </tt>&nbsp;<tt> </tt>&nbsp;Node label.  If NULL, a label will automatically be generated. <P>
int   <I>position</I><tt> </tt>&nbsp;<tt> </tt>&nbsp;(in)<BR>
<tt> </tt>&nbsp;<tt> </tt>&nbsp;Position in the parent's list of children to insert the new node. 
<H2><A NAME="sect3" HREF="#toc3">Description</A></H2>
<P>
This
procedure creates a new node is a tree data object.  The node is initially
empty, but data values can be added with <B>Blt_TreeSetValue</B>.  Each node has
a serial number that identifies it within the tree.  No two nodes in the
same tree will ever have the same ID.  You can find a node's ID with <B>Blt_TreeNodeId</B>.
<P>
The arguments are as follows: 
<DL>

<DT><I>tree</I> </DT>
<DD>The tree containing the parent node.
</DD>

<DT><I>parent</I> </DT>
<DD>Node in which the new child will be inserted.  </DD>

<DT><I>name</I> </DT>
<DD>Label of the
new node.  If <I>name</I> is NULL, a label in the form "node0", "node1", etc.
will automatically be generated.  <I>Name</I> can be any string.  Labels are non-unique.
 A parent can contain two nodes with the same label. Nodes can be relabeled
using <B>Blt_TreeRelabelNode</B>. </DD>

<DT><I>position</I> </DT>
<DD>Position the parent's list of children
to insert the new node.  For example, if <I>position</I> is 0, then the new node
is prepended to the beginning of the list.  If <I>position</I> is -1, then the node
is appended onto the end of the parent's list.   </DD>
</DL>
<P>

<H2><A NAME="sect4" HREF="#toc4">Returns</A></H2>
The new node returned
is of type <B>Blt_TreeNode</B>.  It's a token that can be used with other routines
to add/delete data values or children nodes. 
<H2><A NAME="sect5" HREF="#toc5">Example</A></H2>
The following example
creates a new node from the root node. <BR>
<CODE>Blt_Tree token;<BR>
Blt_TreeNode root, node;<BR>
<P>
if (Blt_TreeGetToken(interp, "myTree", &amp;token) != TCL_OK) {<BR>
    return TCL_ERROR;<BR>
}<BR>
root = Blt_TreeRootNode(token);<BR>
node = Blt_TreeCreateNode(token, root, "myNode", -1);<BR>

<H2><A NAME="sect6" HREF="#toc6"></CODE>Notifications</A></H2>
<B>Blt_TreeCreateNode</B> can trigger tree notify events. You can
be notified whenever a node is created by using the  <B>Blt_TreeCreateNotifyHandler</B>.
 A callback routine is registered that will be automatically invoked whenever
a new node is added via <B>Blt_TreeCreateNode</B> to the tree. 
<H2><A NAME="sect7" HREF="#toc7">Keywords</A></H2>
tree, token
<P>

<HR><P>
<A NAME="toc"><B>Table of Contents</B></A><P>
<UL>
<LI><A NAME="toc0" HREF="#sect0">Name</A></LI>
<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI>
<LI><A NAME="toc2" HREF="#sect2">Arguments</A></LI>
<LI><A NAME="toc3" HREF="#sect3">Description</A></LI>
<LI><A NAME="toc4" HREF="#sect4">Returns</A></LI>
<LI><A NAME="toc5" HREF="#sect5">Example</A></LI>
<LI><A NAME="toc6" HREF="#sect6">Notifications</A></LI>
<LI><A NAME="toc7" HREF="#sect7">Keywords</A></LI>
</UL>
</BODY></HTML>