Callback
PropertyUser Action Components That Use This
Property
WindowButtonM
otionFcnEnd user moves the pointer within
the figure window.figureWindowButtonU
pFcnEnd user releases a mouse button. figureWindowKeyPres
sFcnEnd user presses a key while the
pointer is on the figure or any of
its child objects.figureWindowKeyRele
aseFcnEnd user releases a key while the
pointer is on the figure or any of
its child objects.figureWindowScrollW
heelFcnEnd user turns the mouse wheel
while the pointer is on the figure.figureGUIDE-Generated Callback Functions and Property Values
How GUIDE Manages Callback Functions and PropertiesAfter you add a uicontrol, uimenu, or uicontextmenu component to your UI, but
before you save it, GUIDE populates the Callback property with the value, %automatic.
This value indicates that GUIDE will generate a name for the callback function.When you save your UI, GUIDE adds an empty callback function definition to your code
file, and it sets the control’s Callback property to be an anonymous function. This
function definition is an example of a GUIDE-generated callback function for a push
button.
function pushbutton1_Callback(hObject,eventdata,handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
end
If you save this UI with the name, myui, then GUIDE sets the push button’s Callback
property to the following value:
@(hObject,eventdata)myui('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
This is an anonymous function that serves as a reference to the function,
pushbutton1_Callback. This anonymous function has four input arguments. The first7 Programming a GUIDE App