Treeview.InsertLeaf -- insert new tree leaf
moai.DoMethod(id, "InsertLeaf", id$, node$, pred$, [icon1,] entry1$, ...)
Inserts a new leaf into the treeview at the position which is defined by node$ and pred$. A leaf is a treeview item that doesn't have any children. id$ must be a unique string identifier that you want to use to refer to the newly inserted treeview leaf.

The entry data for the new leaf has to be passed in the last parameters. If the treeview has multiple columns, you need to pass individual entry data for all the columns in the treeview. The entry data consists of a text string and, if the column has the Treeviewcolumn.Icon attribute set, an icon for each column. The icon has to be passed before the text string and it has to be an identifier of a Hollywood brush/icon which should be used as the icon for the entry. If Treeviewcolumn.Icon isn't set, then you must omit the icon parameter and only pass text data for the treeview entry. If you've set Treeviewcolumn.Icon to True and you don't want to show an icon in this particular row and column, you can also pass the special value -1. In that case, RapaGUI won't show an icon even though Treeviewcolumn.Icon has been set to True. 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 case a column is showing a checkbox, you have to pass "On", "True", or "1" to select the checkbox and any other text to deselect the checkbox.

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

The root node.

In pred$ you have to specify the node or leaf which will become the predecessor of the leaf to insert, i.e. the new leaf 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:

Insert as the first node child.

Insert as the last node child.

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.

id of the treeview object
unique string identifier for new treeview leaf
id of node to insert into or special value (see above)
id of the predecessor node or leaf or special value (see above)
optional: icon for entry in the first column; this must only be passed if the column has the icon attribute set; note that this must be a numeric identifier and auto-generated IDs are not valid in this case
entry to insert into the first column
more entries if treeview has multiple columns

Show TOC