Blt_TreeDeleteNode(3)
π Blt_TreeDeleteNode β the "bye bestie, take your whole family with you" procedure π
okay so this is a page from the BLT Library Procedures manual, and the star of the show is Blt_TreeDeleteNode(3). sit down, grab a strawberry π, and let's get into it.
β¨ NAME β¨
Blt_TreeDeleteNode β deletes a node and its descendants. not just the node. the whole bloodline. π
πΈ SYNOPSIS πΈ
#include <bltTree.h>
Blt_TreeNode
Blt_TreeDeleteNode(tree, node)
π ARGUMENTS π
Blt_Tree tree(in) β the tree containing the node. your tree. the one you're about to do surgery on.Blt_TreeNode node(in) β the node to be deleted. the target. π
π DESCRIPTION π
so what does it actually do? this procedure deletes a given node and all its descendants from a tree data object. it's giving spring cleaning. it's giving "we're not doing that branch of the family tree anymore." β¨
the arguments, one by one:
treeβ the tree containing the parent node.nodeβ node to be deleted. the node and its descendant nodes are deleted. and not just the nodes themselves β each node's data values get deleted too. also, the reference count of theTcl_Objis decremented. yes, it's thorough. it's an overachiever. we love that for it. π
β οΈ important caveat bestie: 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. so here's the tea β you can clear a tree by deleting its root, but the root node will remain until the tree is destroyed. it's not ghosting you, it literally cannot leave. π
π₯ RETURNS π₯
always returns TCL_OK. always. no drama, no surprises.
but heads up: errors generated in notification callbacks are backgrounded (see Tcl_TreeCreateNotifyHandler). so like, the drama happens off-screen. π
π¦ EXAMPLE π¦
the following example deletes the root node:
Blt_TreeNode root;
root = Blt_TreeRootNode(token);
Blt_TreeDeleteNode(token, root);
iconic. short. efficient. ate and left no crumbs. π
π NOTIFICATIONS π
Blt_TreeDeleteNode can trigger tree notify events. you can be notified whenever a node is deleted by using the Blt_TreeCreateNotifyHandler. a callback routine is registered that will be automatically invoked whenever a node is deleted via Blt_TreeDeleteNode to the tree. so basically you get a little ping every time something gets yeeted. π main character energy fr fr.
β KEYWORDS β
tree, token
and that's the whole page, bestie. no cap, every single detail is still in there β we just made it cute. this was BLT 2.5, and the page you're reading is Blt_TreeDeleteNode(3) from the BLT Library Procedures manual. mwah. π«Άπβ¨
π¦ where this page comes from
- debian bookworm: blt-dev 2.5.3+dfsg-4.1
- debian trixie: blt-dev 2.5.3+dfsg-8
- nixpkgs unstable: blt 2.5.3
- ubuntu jammy: blt-dev 2.5.3+dfsg-4.1build2
- ubuntu noble: blt-dev 2.5.3+dfsg-7build1
- ubuntu questing: blt-dev 2.5.3+dfsg-8
- ubuntu resolute: blt-dev 2.5.3+dfsg-8build1
- ubuntu stonking: blt-dev 2.5.3+dfsg-9
- Copyright 1991-1998 by Bell Labs Innovations for Lucent Technologies
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms