Name
Treeview.InsertNode -- insert new tree node
Synopsis
moai.DoMethod(id, "InsertNode", id$, node$, pred$, entry$[, icon])
Function
Inserts a new node into the treeview at the position which is defined by node$ and pred$. A node is a treeview item that can have children and that can be opened by the user. id$ must be a unique string identifier that you want to use to refer to the newly inserted treeview node.

entry$ specifies the desired label for the new node. Optionally, you can also pass the id of a Hollywood brush/icon in the optional icon argument if you want to have an icon shown next to the node label. Note that node icons are always supported. You don't have to set Treeviewcolumn.Icon to True in order to show icons next to node labels. Treeviewcolumn.Icon only applies to leaves, nodes always support icons. Please note that auto-generated IDs cannot be used. Please also read about RapaGUI's image cache to learn more about icon support in RapaGUI. See Image cache for details.

In node$ you have to pass the node whose list is used to insert the new node. This can be the string identifier of a node or one of the following special values:

Root
The root node.

In pred$ you have to specify the node or leaf which will become the predecessor of the node to insert, i.e. the new node will be inserted after the item specified in pred$. This can be the string identifier of a node or a leaf or one of the following special values:

Head
Insert as the first node child.

Tail
Insert as the last node child.

Active
Insert after the active item. If there is no active entry, the item will be inserted as the last node child.

Note that on AmigaOS and compatibles icon support is only available with MUI 4.0 or better.

Inputs
id
id of the treeview object
id$
unique string identifier for new treeview node
node$
id of node to insert into or special value (see above)
pred$
id of predecessor node or leaf or special value (see above)
entry$
desired node label
icon
optional: desired node icon (defaults to -1 which means no icon); note that this must be a numeric identifier and auto-generated IDs are not valid in this case

Show TOC