User`s guide

15 Examples of GUIs Created Programmatically
7 Callback definitions. These callbacks, which service the GUI components,
are subfunctions of the
colorPalette function and so h ave access to the
data and component handles created at the top level, without their having
to be passed as arguments.
8 Helper function definitions. These helper functions are subfunctions of
the
colorPalette function and so have access to the data and component
handles created at the top level, without their having to be passed as
arguments.
Note For information about using nested functions, see “Nested Functions”.
GUI Programming Techniques
This topic explains the following GUI programming techniques as they are
used in the creation of the colorPalette.
“Pass Input Arguments to a GUI” on page 15-58
“Pass Output to a Caller on Returning” on page 15-60
“Share Data Between Two GUIs” on page 15-60
See “Icon Editor” on page 15-63 for additional examples of these and other
programming techniques.
Pass Input Arguments to a GUI
Inputs to the GUI are custom property/value pairs. colorPale tte allows one
such property:
Parent. The names are case insensitive. The colorPalette
syntax is
mGetColorFcn = colorPalette('Parent',hPaletteContainer)
Definition and Initialization of the Properties. The colorPalette
function first defines a variable mInputArgs as varargin to accept the user
input arguments.
mInputArgs = varargin; % Command line arguments when invoking
%theGUI
15-58