MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Uživatelský manuál Strana 187

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 330
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 186
Initialization Callbacks
8-15
Initialization Callbacks
GUIDE automatically includes two callbacks, the opening function and the
output function, in every GUI M-file it creates.
“Opening Function” on page 8-15
“Output Function” on page 8-17
For information about programming component callbacks, see “Examples:
Programming GUI Components” on page 8-19.
Opening Function
The opening function is the first callback in every GUI M-file. It is executed just
before the GUI is made visible to the user, but after all the components have
been created, i.e., after the components’
CreateFcn callbacks, if any, have been
run.
You can use the opening function to perform your initialization tasks before the
user has access to the GUI. For example, you can use it to create data or to read
data from an external source. GUI command line arguments are passed to the
opening function.
“Function Naming and Template” on page 8-15
“Input Arguments” on page 8-16
“Initial Template Code” on page 8-16
Function Naming and Template
GUIDE names the opening function by appending _OpeningFcn to the name of
the M-file. This is an example of an opening function template as it might
appear in the
mygui M-file.
% --- Executes just before mygui is made visible.
function mygui_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to mygui (see VARARGIN)
Zobrazit stránku 186
1 2 ... 182 183 184 185 186 187 188 189 190 191 192 ... 329 330

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

Žádné komentáře