MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Guía de usuario Pagina 735

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 759
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 734
Icon Editor
“Retrieve Output o n R eturn from a GUI” on page 15-73
“Protect a GUI from Inadvertent Access” on p age 15-74
“Run a GUI on Multiple Platforms” on page 15-75
“Make a GUI Modal” on page 15-76
“Share Data Between Two GUIs” on page 15-77
“Achieve Proper Resize Behavior” on page 15-78
Return Only After the User Makes a Choice
At the end of the initialization code, and just before returning, iconEditor calls
uiwait with the handle of the main figure to make the GUI blocking.
% Make the GUI blocking
uiwait(hMainFigure);
% Return the edited icon CD ata if it is requested
mOutputArgs{1} =hMainFigure;
mOutputArgs{2} =mIconCData;
if nargout>0
[varargout{1:nargout}] = mOutputAr gs{:};
end
Placement of the call to ui wait is important. C allin g ui wait stops the
sequential execution of
iconEdit.m after the GUI initializes and just before
the file would return the edited icon data.
When the user clicks the OK button, its callback,
hOKButtonCallback,calls
uiresume whichenablesthecodefiletoresumeexecutionwhereitstopped
and return the edited icon data.
function hOKBut tonC allback(hObject, ev entd ata)
% Callback called when the OK button is pr essed
uiresume;
delete(hMainFigure);
end
15-71
Vista de pagina 734
1 2 ... 730 731 732 733 734 735 736 737 738 739 740 ... 758 759

Comentarios a estos manuales

Sin comentarios