Download What Is a GUI? - Parent Directory

Transcript
Color Palette
7 Callback definitions. These callbacks, which service the GUI components,
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.
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” in
the MATLAB Programming documentation.
GUI Programming Techniques
This topic explains the following GUI programming techniques as they are
used in the creation of the colorPalette.
• “Passing Input Arguments to a GUI” on page 14-23
• “Passing Output to a Caller on Returning” on page 14-25
• “Sharing Data Between Two GUIs” on page 14-25
See “Icon Editor” on page 14-28 for additional examples of these and other
programming techniques.
Passing Input Arguments to a GUI
Inputs to the GUI are custom property/value pairs. colorPalette 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.
14-23