[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'ComCtrls' (#lcl)

# TTreeNodes.InternalAddObject

Creates or updates a tree node with the specified text and a pointer to data.

## Declaration

Source position: comctrls.pp line 3240

`protected function TTreeNodes.InternalAddObject(`
`Node: TTreeNode;`
`const S: string;`
`Data: Pointer;`
`AddMode: TAddMode`
`):TTreeNode;`

## Arguments

`Node` |  | An existing tree node to update, or Nil to create a new tree node.
`S` |  | Text for the tree node.
`Data` |  | Pointer to the data for the tree node.
`AddMode` |  | Position in the tree hierarchy where the node is stored.

## Function result

TTreeNode instance created or updated in the method.

## Description

Expands the parent for the Node (when assigned). Updates the accessibility role, description, and value when enabled in the tree view which owns the container. Updates the scroll bars for the tree view control prior to exit.

Used in the implementation of methods like: AddNode, AddObject, Insert, AddChildObject, et. al.

## Errors

Raises an ETreeNodeError exception if the Owner for the container (the tree view control) has not been assigned.