Blt_TreeCreateNode(3) | BLT Library Procedures | Blt_TreeCreateNode(3) |
Blt_TreeCreateNode - Creates a node in a tree data object.
#include <bltTree.h> Blt_TreeNode Blt_TreeCreateNode(tree, parent, name, position)
This procedure creates a new node is a tree data object. The node is initially empty, but data values can be added with Blt_TreeSetValue. 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 Blt_TreeNodeId.
The arguments are as follows:
The new node returned is of type Blt_TreeNode. It's a token that can be used with other routines to add/delete data values or children nodes.
The following example creates a new node from the root node.
Blt_Tree token; Blt_TreeNode root, node; if (Blt_TreeGetToken(interp, "myTree", &token) != TCL_OK) {
return TCL_ERROR; } root = Blt_TreeRootNode(token); node = Blt_TreeCreateNode(token, root, "myNode", -1);
Blt_TreeCreateNode can trigger tree notify events. You can be notified whenever a node is created by using the Blt_TreeCreateNotifyHandler. A callback routine is registered that will be automatically invoked whenever a new node is added via Blt_TreeCreateNode to the tree.
tree, token
2.5 | BLT |