MATLAB Creating Graphical User Interfaces

(ff) #1

(^6) From the File menu, select Save.
(^7) In the Save dialog box, in the File name field, type closedlg.fig. Then, click
Save.
The code file, closedlg.m, opens in the Editor.
On the Editor tab, in the Navigate section, click Go To, and then select
pushbutton1_Callback.
Then, locate the following generated code in the Editor:
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to close_pushbutton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
(^8) Add the following code immediately after the comment that begins with %
handles....
% Get the current position from the handles structure
% to pass to the modal dialog.
8 Examples of GUIDE UIs

Free download pdf