필터 지우기
필터 지우기

How to update a uitree in a GUI

조회 수: 4 (최근 30일)
Nuno Benavente
Nuno Benavente 2013년 5월 13일
답변: Christian R. 2019년 2월 23일
Hello there, I have implemented a uitree with a context menu, following the general guidelines of Yair Altman. The uitree displays a list of existing files in a folder. The nodes are constructed one by one through a for cycle which reads the file names. The context menu allows, among other options, to delete any of those files. The problem is, when I delete a file, the tree is not updated, but that was expected. How can I update it to reflect the file deletion?
What I've tried is to rebuild the whole tree but when in my function which does that calls uitree...
[handles.mtree,handles.container] = uitree('v0', 'Root', handles.treeRoot, 'Parent', handles.treePanel);
set(handles.container, 'Parent', handles.treePanel) % fix the uitree Parent
the uitree is created in a new figure, not in its original figure's parent 'handles.treePanel'
Thanks in advance!

답변 (1개)

Christian R.
Christian R. 2019년 2월 23일
delete(t.Children) and ovewrite the tree.

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by