"insertItem", "insertItemNC"

The attributes "insertItem"; and "insertItemNC"; both add an item to a tree widget.

Synopsis

shape.insertItem(string parentId, string Id, string|dyn_string text);

shape.insertItemNC(string parentId, string Id, string|dyn_string text);

Parameters

Parameter Description
shape Object name.
parentId The parent element.
Id The Id of the element.
text The text in the element's first column. Using the dyn_string allows to define texts for multiple columns.

Description

The attributes "insertItem"; and "insertItemNC"; both add an item to a tree widget. The difference is that "insertItemNC" does not check for duplicates meaning if an element already exists. Use "insertItemNC" for new tree widgets when it is not necessary to check the duplicates.

The item structure can be defined only in the first column. The remaining columns can contain only description texts (column entry of an item) added with "setText". For an example see "appendItem".

Example

The following example adds the item "TEST"; to a tree widget. The parent element is "ENGINE"; and the text of the element is "TEST";.

main()
{
  TREE1.insertItem("ENGINE","TEST","TEST");
}

Assignment

Tree widget