Specifications
3 Laying Out GUIs and Setting Properties
3-42
Some Commonly Used Properties
As examples, this section describes four important and commonly used
properties of user interface control components:
Tag, Callback, String, and
Value.
Tag
The Tag property is an identifier for the component. GUIDE assigns a value to
the
Tag property of every component you insert in your layout (e.g.,
pushbutton1) and then uses this string to name the callback associated with
the
Callback property (e.g., pushbutton1_Callback). You should change the
Tag property to a more descriptive name, so that you can more easily identify
the component’s callback in the M-file. For example, if you add a push button
that closes the GUI, you might set its tag to
close_button.
GUIDE uses the
Tag property to
• Construct the name of the generated callback (e.g.,
close_button_Callback)
when you run or save the GUI
• Set corresponding callback properties to point to the callback.
• Add a field to the
handles structure containing the handle of the object (e.g.,
handles.close_button)
Note Since GUIDE uses the Tag property to name functions and structure
fields, the tag you select must be a valid MATLAB variable name. Use
isvarname to determine if the string you want to use is valid.
Panel Uipanel Properties
Button group Uibuttongroup Properties
Menu Uimenu Properties
Context menu (associated with a
component using its Uicontextmenu
property)
Uicontextmenu Properties
Component Property Reference Page