h = uitree()
h = uitree(parent)
h = uitree(..., propertyName, propertyValue)
| Parameter | Description |
|---|---|
| parent | parent object. |
| propertyName, propertyValue | name-value pairs. |
| Parameter | Description |
|---|---|
| h | UI object. |
t = uitree creates a tree; uitree(parent, 'checkbox') creates a check box tree. Children are uitreenode objects. Properties: SelectedNodes, Multiselect (standard tree), CheckedNodes/CheckedNodesChangedFcn (checkbox tree), Editable, SelectionChangedFcn, NodeExpandedFcn, NodeCollapsedFcn. Use expand(t) / collapse(t).
f = uifigure('Visible', 'off', 'Name', 'Tree', 'Position', [100 100 420 260]);
tr = uitree(f, 'Position', [70 40 210 180]);
n1 = uitreenode(tr, 'Text', 'Fruits');
uitreenode(n1, 'Text', 'Apple');
uitreenode(n1, 'Text', 'Banana');
expand(tr);
drawnow();
f = uifigure();
t = uitree(f);
n1 = uitreenode(t, 'Text', 'Fruits');
n2 = uitreenode(n1, 'Text', 'Apple');
expand(t);
| Version | Description |
|---|---|
| 2.0.0 | initial version |