"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');
Impossibile completare l'azione a causa delle modifiche apportate alla pagina. Ricarica la pagina per vedere lo stato aggiornato.
Translated by
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.