How do I delete nodes from a "uitree"?

26 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2018 年 11 月 13 日
編集済み: MathWorks Support Team 2023 年 6 月 23 日
I am making an app with App Designer and I would like to remove nodes from a "uitree" object. I would like to be able to remove them one at a time or clear the entire tree. Is that possible in MATLAB?

採用された回答

MathWorks Support Team
MathWorks Support Team 2023 年 6 月 23 日
編集済み: MathWorks Support Team 2023 年 6 月 23 日
To remove a single node from a "uitree", simply call its built-in 'delete' method. For example, if the node you want to delete is called 'app.node', you can delete it using this command:
>> app.node.delete;
If you want to delete all the nodes in a tree, you need to first take the list of all nodes (stored as the 'Children' property of the tree), then call the delete method on that list. If the tree that you want to clear is called 'app.Tree', the following commands will delete all of its nodes:
>> a = app.Tree.Children;
>> a.delete;

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by