Borrar filtros
Borrar filtros

Copy nodes and sub-nodes of uitree to another uitree

11 visualizaciones (últimos 30 días)
Hossein Sadeghi
Hossein Sadeghi el 15 de Feb. de 2022
Respondida: James Sweetman el 2 de En. de 2023
Hi,
I have two trees in app-designer and created some nodes and subnodes in one of them as follows:
for i=1:length(data1)
nodes(i) = uitreenode(tree1,'Text',data1(i));
subnodes(i) = uitreenode(nodes(i),'Text',data2(i));
end
Now I want to copy these nodes and subnodes to the second tree. I used:
Copyobj(nodes, tree2);
This works fine when the tree has no subnodes, but throw error for my case with subnodes.
  2 comentarios
Simon Chan
Simon Chan el 15 de Feb. de 2022
Did you try the following?
copyobj(nodes(1),tree2)
copyobj(nodes(2),tree2)
Hossein Sadeghi
Hossein Sadeghi el 15 de Feb. de 2022
Yes, same error!

Iniciar sesión para comentar.

Respuestas (1)

James Sweetman
James Sweetman el 2 de En. de 2023
This seems to work!
arrayfun(@(x,y) copyobj(flipud(x.Children),y),tree1,tree2)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by