Specifications
4 Programming GUIs
4-42
Setting Up the GUI with the Close Button
To set up the second GUI with a Close button, do the following:
1 Select New from the File menu in the GUIDE Layout Editor.
2 In the GUIDE Quick Start dialog, select Blank GUI (Default) and click OK.
This opens the blank GUI in a new Layout Editor window.
3 Drag a push button from the Component palette of the Layout Editor into
the layout area.
4 Right-click the push button and select Property Inspector from the pop-up
menu.
5 Change the String property to Close.
6 Change the Tag property to close_pushbutton.
7 Click the M-file editor icon on the toolbar of the Layout Editor.
8 Click the callback icon on the toolbar of the M-file editor and select
close_pushbutton_Callback from the menu.
The following generated code for the close button callback should appear in
the M-file editor:
% --- Executes on button press in close_pushbutton.
function close_pushbutton_Callback(hObject, eventdata, handles)
% hObject handle to close_pushbutton (see GCBO)