MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Especificações Página 163

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 216
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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:
Vista de página 162
1 2 ... 158 159 160 161 162 163 164 165 166 167 168 ... 215 216

Comentários a estes Manuais

Sem comentários