
GUI with Axes, Menu, and Toolbar
12-17
• The uipushtool TooltipString property assigns a tool tip that displays when
the GUI user moves the mouse pointer over the button and leaves it there.
• The
CData property specifies a truecolor image that displays on the button.
For these two buttons, the utility
iconRead function supplies the image. If
you are reading this in the MATLAB Help browser, click here to display this
utility M-file in the MATLAB Editor.
• For each of the uipushtools, the
ClickedCallback property specifies the
callback that executes when the GUI user clicks the button. Note that the
Open push button and the Print push button use the same callbacks as
their counterpart menu items.
See the Uitoolbar Properties reference page for information about properties of
uitoolbar objects and their default values. See the Uipushtool Properties
reference page for information about properties of
uipushtool objects.
Initializing the GUI
These statements create the plot that appears in the GUI when it first displays,
and define the output that is returned to the user if the user provides an output
argument when running the GUI.
% Update the plot with the initial plot type
localUpdatePlot();
% Define default output and return it if it is requested by users
mOutputArgs{1} = hMainFigure;
if nargout>0
[varargout{1:nargout}] = mOutputArgs{:};
end
• The localUpdatePlot function plots the selected plot type in the axes. For a
pop-up menu, the uicontrol
Value property specifies the index of the selected
menu item in the
String property. Since the default value is 1, the initial
selection is
'plot(rand(5))'. The localUpdatePlot function is a helper
function that is defined later in the script, at the same level as the callbacks.
• The default output is the handle of the main figure.
Comentários a estes Manuais