
8 Programming the GUI
8-12
When GUIDE generates the template, it creates the callback name by
appending an underscore (_) and the name of the callback property to the
component’s
Tag property. In the example above, pushbutton1 is the Tag
property for the push button, and
Callback is one of the push button’s callback
properties. The
Tag property uniquely identifies a component within the GUI.
The first time you save the GUI after adding a component, GUIDE adds
callbacks for that component to the M-file and generates the callback names
using the current value of the
Tag property. If you want to change the default
Tag value, you should do it before you save the GUI.
See “Associating Callbacks with Components” on page 8-8 for more
information.
Changing Callback Names Assigned by GUIDE
You can change callback names assigned by GUIDE in either of the following
ways:
• “Changing the Tag Property” on page 8-12
• “Changing the Callback Property” on page 8-13
Note If possible, change callback names for a component immediately after
you add the component to the layout and before you save the GUI.
Changing the Tag Property
You can change Tag properties to give a component’s callbacks a more
meaningful name, e.g., you might change the
Tag property from pushbutton1
to
closebutton. If possible, change the Tag property before saving the GUI,
then GUIDE automatically uses the new value when it names the callbacks.
However, if you change the
Tag property after saving the GUI, GUIDE updates
the following items according to the new
Tag, provided that all components
have distinct tags:
• The component’s callback functions in the M-file
• The value of the component’s callback properties, which you can view in the
Property Inspector
Comentarios a estos manuales