MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Instrukcja Użytkownika Strona 189

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 330
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 188
Initialization Callbacks
8-17
handles.output = hObject adds a new element, output, to the handles
structure and assigns it the value of the input argument
hObject, which is
the handle of the figure, i.e., the handle of the GUI. This handle is used later
by the output function. For more information about the output function, see
“Output Function” on page 8-17.
guidata(hObject,handles) saves the handles structure. You must use
guidata to save any changes that you make to the handles structure. It is
not sufficient just to set the value of a
handles field. See “The Handles
Structure” on page 8-13 and “GUI Data” on page 9-2 or more information.
uiwait(handles.mygui), initially commented out, blocks GUI execution
until
uiresume is called or the GUI is deleted. Note that uiwait allows the
user access to other MATLAB windows. Remove the comment symbol for this
statement if you want the GUI to be blocking when it opens.
Output Function
The output function returns, to the command line, outputs that are generated
during its execution. It is executed when the opening function returns control
and before control returns to the command line. This means that you must
generate the outputs in the opening function, or call
uiwait in the opening
function to pause its execution while other callbacks generate outputs.
“Function Naming and Template” on page 8-17
“Input Arguments” on page 8-18
“Output Arguments” on page 8-18
Function Naming and Template
GUIDE names the output function by appending _OutputFcn to the name of
the M-file. This is an example of an output function template as it might appear
in the
mygui M-file.
% --- Outputs from this function are returned to the command line.
function varargout = mygui_OutputFcn(hObject, eventdata,...
handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
Przeglądanie stron 188
1 2 ... 184 185 186 187 188 189 190 191 192 193 194 ... 329 330

Komentarze do niniejszej Instrukcji

Brak uwag