Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

move

(App Designer) Move tree node

Use only for App Designer apps, or when creating apps with the uifigure function.

Syntax

move(targetnode,siblingnode)
move(targetnode,siblingnode,location)

Description

example

move(targetnode,siblingnode) moves the target node after the specified sibling node.

example

move(targetnode,siblingnode,location) moves the target node after or before the specified sibling node. Specify location as 'after' or 'before'.

Examples

collapse all

Create a tree containing two top-level nodes that each contain a child node.

f = uifigure;
tree = uitree(f,'Position',[20 20 200 150]);
node1 = uitreenode(tree,'Text','Runners');
node2 = uitreenode(tree,'Text','Cyclists');
runner = uitreenode(node1,'Text','Joe');
cyclist = uitreenode(node2,'Text','Rajeev');

Move Cyclists before Runners.

move(node2,node1,'before');

Move Cyclists after Runners. Since the default value of location is 'after', you can omit that argument.

move(node2,node1);

Input Arguments

collapse all

Target node, specified as a TreeNode object.

Sibling node, specified as a TreeNode object.

Target location, specified as 'after' or 'before'.

Introduced in R2017b

Was this topic helpful?