
Associating Callbacks with Components
8-9
-
When you save the GUI, GUIDE constructs the name of the callback by
appending an underscore (
_) and the name of the callback property to the value
of the component’s
Tag property. For example, the MATLAB expression for the
Callback property for a push button in the GUI simple_gui with Tag property
pushbutton1 is
simple_gui(pushbutton1_Callback,gcbo,[],guidata(gcbo))
simple_gui is the name of the GUI M-file as well as the name of the main
function for that GUI. The remaining arguments generate input arguments for
pushbutton1_Callback. Specifically,
•
gcbo is a command that returns the handle of the callback object (i.e.,
pushbutton1).
•
[] is a place holder for the currently unused eventdata argument.
•
guidata(gcbo) returns the handles structure for this GUI.
...
Komentáře k této Příručce