GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  BLT_TREECREATENODE (3)

NAME

Blt_TreeCreateNode - Creates a node in a tree data object.

CONTENTS

Synopsis
Arguments
Description
Returns
Example
Notifications
Keywords

SYNOPSIS

#include <bltTree.h>

Blt_TreeNode Blt_TreeCreateNode(tree, parent, name, position)

ARGUMENTS


.TP 15 Blt_Tree  tree(in)
Blt_Tree  tree Blt_Tree Tree containing the parent node.
.TP 15 Blt_TreeNodeparent(in)
Blt_TreeNodeparent Blt_TreeNode Node in which to insert the new child.
.TP 15 const char*name(in)
const char*name const char Node label. If NULL, a label will automatically be generated.
.TP 15 int       position(in)
int       position int Position in the parent’s list of children to insert the new node.

   








\L’|0u-1v’\l’75u+3n_’\L’0u+1v-0u’\l’|0u-1.5n_’



\L’|0u-1v’\L’0u+1v-0u’\l’|0u-1.5n_’





DESCRIPTION

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:
tree The tree containing the parent node.
parent Node in which the new child will be inserted.
name Label of the new node. If name is NULL, a label in the form "node0", "node1", etc. will automatically be generated. Name can be any string. Labels are non-unique. A parent can contain two nodes with the same label. Nodes can be relabeled using Blt_TreeRelabelNode.
position Position the parent’s list of children to insert the new node. For example, if position is 0, then the new node is prepended to the beginning of the list. If position is -1, then the node is appended onto the end of the parent’s list.

RETURNS

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.

EXAMPLE

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);

NOTIFICATIONS

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.

KEYWORDS

tree, token
Search for    or go to Top of page |  Section 3 |  Main Index


BLT BLT_TREECREATENODE (3) 2.5

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.