---
name: "Blt_TreeGetNode"
section: "3"
platform: "linux"
package: "blt-dev"
version: "2.5.3+dfsg-8"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Blt_TreeGetNode"
---

# Blt\_TreeGetNode(3)

Finds the node from the ID.

```

```

## NAME

Blt\_TreeGetNode - Finds the node from the ID.

## SYNOPSIS

```
#include <bltTree.h>

Blt_TreeNode
Blt_TreeGetNode(tree, number)
```

## ARGUMENTS

- Blt\_Tree *tree* (in)

  Tree containing the requested node.

- unsigned int *number* (in)

  Serial number of the requested node.

  ```

  ```

## DESCRIPTION

This procedure returns a node in a tree object  based upon a give serial number.   The node is searched using the serial number.

The arguments are as follows:

- *tree*

  The tree containing the requested node.

- *number*

  The serial number of the requested node.

## RETURNS

The node represented by the given serial number is returned.  If no node with that ID exists in *tree* then NULL is returned.

## EXAMPLE

The following example gets the node from a serial number.

```

unsigned int number;
Blt_TreeNode node;
Blt_TreeToken token;
...
node = Blt_TreeGetNode(token, number);
if (node == NULL) {
    printf("no node with ID %d exists\n", number);
} else {
    printf("node found: label is %s\n", Blt_TreeNodeLabel(node));
}
```

## KEYWORDS

Tcl\_TreeCreateNode, Tcl\_TreeDeleteNode
