MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Dokumentacja Strona 163

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 216
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 162
Example: Using the Modal Dialog to Confirm an Operation
4-43
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
9 After these comments, add the following code:
% Get the current position of the GUI from the handles structure
% to pass to the modal dialog.
pos_size = get(handles.figure1,'Position');
% Call modaldlg with the argument 'Position'.
user_response = modaldlg('Title','Confirm Close');
switch user_response
case {'No'}
% take no action
case 'Yes'
% Prepare to close GUI application window
% .
% .
% .
delete(handles.figure1)
end
Running the GUI with the Close Button
Run the GUI with the Close button by clicking the Run button on the Layout
Editor toolbar. The GUI appears as in the following figure:
When you click the
Close button on the GUI, the modal dialog appears as
shown in the following figure:
Przeglądanie stron 162
1 2 ... 158 159 160 161 162 163 164 165 166 167 168 ... 215 216

Komentarze do niniejszej Instrukcji

Brak uwag