MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Manual de usuario Pagina 187

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 330
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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)
Vista de pagina 186
1 2 ... 182 183 184 185 186 187 188 189 190 191 192 ... 329 330

Comentarios a estos manuales

Sin comentarios