| 1 |
'\" |
| 2 |
'\" Copyright 1991-1998 by Bell Labs Innovations for Lucent Technologies. |
| 3 |
'\" |
| 4 |
'\" Permission to use, copy, modify, and distribute this software and its |
| 5 |
'\" documentation for any purpose and without fee is hereby granted, provided |
| 6 |
'\" that the above copyright notice appear in all copies and that both that the |
| 7 |
'\" copyright notice and warranty disclaimer appear in supporting documentation, |
| 8 |
'\" and that the names of Lucent Technologies any of their entities not be used |
| 9 |
'\" in advertising or publicity pertaining to distribution of the software |
| 10 |
'\" without specific, written prior permission. |
| 11 |
'\" |
| 12 |
'\" Lucent Technologies disclaims all warranties with regard to this software, |
| 13 |
'\" including all implied warranties of merchantability and fitness. In no event |
| 14 |
'\" shall Lucent Technologies be liable for any special, indirect or |
| 15 |
'\" consequential damages or any damages whatsoever resulting from loss of use, |
| 16 |
'\" data or profits, whether in an action of contract, negligence or other |
| 17 |
'\" tortuous action, arising out of or in connection with the use or performance |
| 18 |
'\" of this software. |
| 19 |
'\" |
| 20 |
'\" |
| 21 |
.so man.macros |
| 22 |
.TH Blt_TreeDeleteNode 3 BLT_VERSION BLT "BLT Library Procedures" |
| 23 |
.BS |
| 24 |
.SH NAME |
| 25 |
Blt_TreeDeleteNode \- Deletes a node and its descendants. |
| 26 |
.SH SYNOPSIS |
| 27 |
.nf |
| 28 |
#include <bltTree.h> |
| 29 |
.sp |
| 30 |
Blt_TreeNode |
| 31 |
\fBBlt_TreeDeleteNode\fR(\fItree\fR, \fInode\fR) |
| 32 |
.fi |
| 33 |
.SH ARGUMENTS |
| 34 |
.AS Blt_TreeNode node |
| 35 |
.AP Blt_Tree tree in |
| 36 |
Tree containing the node. |
| 37 |
.AP Blt_TreeNode node in |
| 38 |
Node to be deleted. |
| 39 |
.BE |
| 40 |
.SH DESCRIPTION |
| 41 |
This procedure deletes a given node and all it descendants from a tree |
| 42 |
data object. |
| 43 |
.PP |
| 44 |
The arguments are as follows: |
| 45 |
.TP 1i |
| 46 |
\fItree\fR |
| 47 |
The tree containing the parent node. |
| 48 |
.TP |
| 49 |
\fInode\fR |
| 50 |
Node to be deleted. The node and its descendant nodes are deleted. |
| 51 |
Each node's data values are deleted also. The reference count of |
| 52 |
the Tcl_Obj is decremented. |
| 53 |
.PP |
| 54 |
Since all tree objects must contain at least a root node, the root |
| 55 |
node itself can't be deleted unless the tree is released and |
| 56 |
destroyed. Therefore you can clear a tree by deleting its root, but |
| 57 |
the root node will remain until the tree is destroyed. |
| 58 |
.SH RETURNS |
| 59 |
Always returns TCL_OK. Errors generated in a notification callbacks |
| 60 |
are backgrounded (see \fBTcl_TreeCreateNotifyHandler\fR). |
| 61 |
.SH EXAMPLE |
| 62 |
The following example deletes the root node. |
| 63 |
.CS |
| 64 |
Blt_TreeNode root; |
| 65 |
|
| 66 |
root = Blt_TreeRootNode(token); |
| 67 |
Blt_TreeDeleteNode(token, root); |
| 68 |
.CE |
| 69 |
.SH NOTIFICATIONS |
| 70 |
\fBBlt_TreeDeleteNode\fR can trigger tree notify events. |
| 71 |
You can be notified whenever a node is deleted by using the |
| 72 |
\fBBlt_TreeCreateNotifyHandler\fR. A callback routine is registered |
| 73 |
that will be automatically invoked whenever a node is deleted |
| 74 |
via \fBBlt_TreeDeleteNode\fR to the tree. |
| 75 |
.SH KEYWORDS |
| 76 |
tree, token |