Creating Graphical User Interfaces Previous page   Next Page

Output Function

The output function returns, to the command line, outputs that were generated during 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. See Example: Using the Modal Dialog to Confirm an Operation for an example that uses uiwait.

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.

Input Arguments

The output function has three input arguments: hObject, eventdata, and handles. They are the same as described in Component and Figure Callbacks.

Output Arguments

The output function has one output argument, varargout, which it returns to the command line. By default, the output function assigns handles.output to varargout. So the default output is the handle to the GUI, which was assigned to handles.output in the opening function.

You can change the output by:


Previous page  Initialization Callbacks in GUIDE Managing Application-Defined Data Next page

© 1994-2005 The MathWorks, Inc.