"uitreenode" objects don't have a direct 'Enable' or 'Interactivity' property to disable user interaction with individual nodes like UI controls do. However, you will be able to simulate non-interactivity by using the Checked property and controlling behavior via a callback, essentially preventing user-initiated changes on the child nodes. Kindly follow the below approach to set the interactivity of uitreenode to 'off'.
Use the CheckedNodesChangedFcn of the uitree.
Revert any user interaction with the child nodes.
Allow interaction only through the top-level node.
Refer to following code as an example.
fig = uifigure;
t = uitree(fig, 'checkbox', 'Position', [20 20 200 200]);
Thank you, shame that such interactivity is not implemented. Your code seems to work OK, but graphically it has some visual glitch which affect the rendering,
I have reconsidered my approach by not using he checked node function, but going for the selected nodes instead. For whoever want to have a try, here is the code:
close all force
clear
clc
buildTreeNode()
function buildTreeNode()
fig = uifigure;
tree = uitree(fig, 'Position', [20 20 200 400],'Multiselect','on');
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.