| Creating Graphical User Interfaces | ![]() |
It is a good idea to use descriptive names for component Tag properties and callback subfunction names. 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 subfunction (e.g., pushbutton1_Callback). You should choose descriptive names for the Tag properties before activating or saving your GUI for the first time.
GUIDE automatically assigns a string to each component's Tag property and uses this string to
tag_Callback) when you run or save the GUI
handles structure containing the handle of the object (e.g., handles.tag)
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.
|
Renaming GUI Files Using Save As
When you rename a GUI FIG-file, by selecting Save As from the Layout Editor File menu, GUIDE also renames the GUI M-file and resets the callback properties to properly execute the callbacks.
| Figure | Changing Component Tag Properties | ![]() |