"uitree"からノードを削除するにはどうすればよいですか?
8 views (last 30 days)
Show older comments
MathWorks Support Team
on 23 Jun 2023
Answered: MathWorks Support Team
on 23 Jun 2023
MATLAB の App Designer で GUI を作成しています。
uitree オブジェクトを配置していますが、例えば、ボタンのコールバックで、nノードを削除することはできるか、教えてください。
Accepted Answer
MathWorks Support Team
on 23 Jun 2023
"uitree" から単一のノードを削除するには、'delete' メソッドをコールします。
例えば、ノードが "app.node" という名前の場合、次のコマンドを使用して削除できます。
>> app.node.delete
or
>> delete(app.node)
また、ツリー内の全てのノードを削除する場合は、全ノードのリスト(ツリーの 'Children'プロパティ)を取得してから、そのリストの delete メソッドを呼び出す必要があります。
例えば、削除したいツリーが "app.Tree" の場合、以下のように記述できます。
a = app.Tree.Children;
a.delete; % or delete(a)
0 Comments
More Answers (0)
See Also
Categories
Find more on App Designer を使用したアプリ開発 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!