MATLAB Creating Graphical User Interfaces

(ff) #1
Some changes you make in the layout can change the size of the grid. For example,
adding a component to a fully populated grid adds a row to accommodate the new
component.

To view the list of component objects in the grid, query the Children property of the
grid. Changing the order in the list does not change the layout in the grid.

Example: Hide Rows Based on Run-Time Conditions


This example shows how to hide components within a row of a grid based on the on the
user's selection in a drop-down menu. The code performs these high-level tasks:


  • Creates grid1, a 1-by-2 grid in the figure that manages a panel and an axes
    component.

  • Creates grid2, a 3-by-2 grid inside the panel. This grid manages the layout of a drop-
    down menu, two spinners, and their labels.


16 App Layout

Free download pdf