MATLAB Creating Graphical User Interfaces

(ff) #1

The grid is invisible, but this picture includes lines to illustrate how the space is
distributed.


To place a component in a specific row and column of the grid, you must:



  • Specify the grid as the parent of the component.

  • Specify the target row and column by setting the Layout property of the component.


For example, this code creates a grid that has the default size (two '1x' rows and two
'1x' columns). Then it places a list box in the first row and second column of that grid.


g = uigridlayout;
list = uilistbox(g);
list.Layout.Row = 1;
list.Layout.Column = 2;


Again, the grid lines in this picture do not appear in the figure.


Using Grid Layout Managers
Free download pdf