MATLAB Creating Graphical User Interfaces

(ff) #1
keys to move them does not accomplish this. Use the Object Browser to verify that
controls are properly nested.

See “Panels and Button Groups” on page 6-39 for more information on how to
incorporate panels and button groups into a UI.

Assign an Identifier to Each Component

Use the Tag property to assign a unique and meaningful identifier to your components.

When you place a component in the layout area, GUIDE assigns a default value to the Tag
property. Before saving the UI, replace this value with a name or abbreviation that
reflects the role of the component in the UI.

The name you assign is used by code to identify the component and must be unique in the
UI. To set the Tag property:

(^1) Select View > Property Inspector or click the Property Inspector button.
(^2) In the layout area, select the component for which you want to set Tag.
(^3) In the Property Inspector, select Tag and then replace the value with the name you
want to use as the identifier. In the following figure, Tag is set to pushbutton1.
User Interface Controls
User interface controls include push buttons, toggle buttons, sliders, radio buttons, edit
text controls, static text controls, pop-up menus, check boxes, and list boxes.
To define user interface controls, you must set certain properties. To do this:
6 Lay Out a UI Using GUIDE

Free download pdf