uifigure+uitree, multiple selected nodes
Hello,
Does anybody know a (undocumented) workaround to have multiple nodes selected in a uitree with checkboxes? I like to distinguish between checked and selected items.
If the uitree component is used without checkboxes it is possible. I am wondering why this is not implemented (yet)…
hF = uifigure();
hT = uitree(hF,’checkbox’);
hO1 = uitreenode(Parent=hT, Text=’object1′);
hO2 = uitreenode(Parent=hT, Text=’object2′);
hO3 = uitreenode(Parent=hT, Text=’object3′);
hO4 = uitreenode(Parent=hT, Text=’object4′);
hT.CheckedNodes = [hO1, hO2];
hT.SelectedNodes = [hO3, hO4];
%Error using matlab.ui.container.internal.model.TreeComponent/set.SelectedNodes (line 161)
%’SelectedNodes’ must be an empty array or a 1-by-1 TreeNode object that is a child in the CheckBoxTree.
Thanks in advance,
MartinHello,
Does anybody know a (undocumented) workaround to have multiple nodes selected in a uitree with checkboxes? I like to distinguish between checked and selected items.
If the uitree component is used without checkboxes it is possible. I am wondering why this is not implemented (yet)…
hF = uifigure();
hT = uitree(hF,’checkbox’);
hO1 = uitreenode(Parent=hT, Text=’object1′);
hO2 = uitreenode(Parent=hT, Text=’object2′);
hO3 = uitreenode(Parent=hT, Text=’object3′);
hO4 = uitreenode(Parent=hT, Text=’object4′);
hT.CheckedNodes = [hO1, hO2];
hT.SelectedNodes = [hO3, hO4];
%Error using matlab.ui.container.internal.model.TreeComponent/set.SelectedNodes (line 161)
%’SelectedNodes’ must be an empty array or a 1-by-1 TreeNode object that is a child in the CheckBoxTree.
Thanks in advance,
Martin Hello,
Does anybody know a (undocumented) workaround to have multiple nodes selected in a uitree with checkboxes? I like to distinguish between checked and selected items.
If the uitree component is used without checkboxes it is possible. I am wondering why this is not implemented (yet)…
hF = uifigure();
hT = uitree(hF,’checkbox’);
hO1 = uitreenode(Parent=hT, Text=’object1′);
hO2 = uitreenode(Parent=hT, Text=’object2′);
hO3 = uitreenode(Parent=hT, Text=’object3′);
hO4 = uitreenode(Parent=hT, Text=’object4′);
hT.CheckedNodes = [hO1, hO2];
hT.SelectedNodes = [hO3, hO4];
%Error using matlab.ui.container.internal.model.TreeComponent/set.SelectedNodes (line 161)
%’SelectedNodes’ must be an empty array or a 1-by-1 TreeNode object that is a child in the CheckBoxTree.
Thanks in advance,
Martin uifigure, uitree, selectednodes MATLAB Answers — New Questions