Creating Graphical User Interfaces | ![]() ![]() |
The Close button callback performs the following steps:
Here is the Close button callback:
function varargout = pushbutton1_Callback(h, eventdata, handles, varargin) pos_size = get(handles.figure1,'Position'); dlg_pos = [pos_size(1)+pos_size(3)/5 pos_size(2)+pos_size(4)/5]; user_response = modaldlg(dlg_pos); switch user_response case {'no','cancel'} return case 'yes'% Prepare to close GUI application figure
% .
% .
% .
delete(handles.figure1) end
![]() | Implementing the GUI | The Confirmation Dialog Application M-file | ![]() |