MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Uživatelská příručka Strana 735

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 759
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 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
Zobrazit stránku 734
1 2 ... 730 731 732 733 734 735 736 737 738 739 740 ... 758 759

Komentáře k této Příručce

Žádné komentáře