<!-- 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_TreeDeleteNode(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_TreeDeleteNode - Deletes a node and its descendants. <H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2> <BR> <PRE>#include <bltTree.h> Blt_TreeNode Blt_TreeDeleteNode(tree, node) </PRE> <H2><A NAME="sect2" HREF="#toc2">Arguments</A></H2> <P> Blt_Tree <I>tree</I><tt> </tt> <tt> </tt> (in)<BR> <tt> </tt> <tt> </tt> Tree containing the node. <P> Blt_TreeNode <I>node</I><tt> </tt> <tt> </tt> (in)<BR> <tt> </tt> <tt> </tt> Node to be deleted. <H2><A NAME="sect3" HREF="#toc3">Description</A></H2> This procedure deletes a given node and all it descendants from a tree data object. <P> The arguments are as follows: <DL> <DT><I>tree</I> </DT> <DD>The tree containing the parent node. </DD> <DT><I>node</I> </DT> <DD>Node to be deleted. The node and its descendant nodes are deleted. Each node's data values are deleted also. The reference count of the Tcl_Obj is decremented. </DD> </DL> <P> Since all tree objects must contain at least a root node, the root node itself can't be deleted unless the tree is released and destroyed. Therefore you can clear a tree by deleting its root, but the root node will remain until the tree is destroyed. <H2><A NAME="sect4" HREF="#toc4">Returns</A></H2> Always returns TCL_OK. Errors generated in a notification callbacks are backgrounded (see <B>Tcl_TreeCreateNotifyHandler</B>). <H2><A NAME="sect5" HREF="#toc5">Example</A></H2> The following example deletes the root node. <BR> <CODE>Blt_TreeNode root;<BR> <P> root = Blt_TreeRootNode(token);<BR> Blt_TreeDeleteNode(token, root);<BR> <H2><A NAME="sect6" HREF="#toc6"></CODE>Notifications</A></H2> <B>Blt_TreeDeleteNode</B> can trigger tree notify events. You can be notified whenever a node is deleted by using the <B>Blt_TreeCreateNotifyHandler</B>. A callback routine is registered that will be automatically invoked whenever a node is deleted via <B>Blt_TreeDeleteNode</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>