MATLAB Creating Graphical User Interfaces

(ff) #1

Set the UI Window Size in GUIDE


Set the size of the UI window by resizing the grid area in the Layout Editor. Click the
lower-right corner of the layout area and drag it until the UI is the desired size. If
necessary, make the window larger.

As you drag the corner handle, the readout in the lower right corner shows the current
position of the UI in pixels.

NoteSetting the Units property to characters (nonresizable UIs) or normalized
(resizable UIs) gives the UI a more consistent appearance across platforms. See “Cross-
Platform Compatible Units” on page 6-107 for more information.

Prevent Existing Objects from Resizing with the Window


Existing objects within the UI resize with the window if their Units are set to
'normalized'. To prevent them from resizing with the window, perform these steps:

(^1) Set each object’s Units property to an absolute value, such as inches or pixels
before enlarging the UI.
To change the Units property for all the objects in your UI simultaneously, drag a
selection box around all the objects, and then click the Property Inspector button
and set the Units.
2 When you finish enlarging the UI, set each object’s Units property back to
normalized.
6 Lay Out a UI Using GUIDE

Free download pdf