"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');
No se puede completar la acción debido a los cambios realizados en la página. Vuelva a cargar la página para ver el estado actualizado.
Translated by
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.