Property Values Description
CData 3-D array of values
between 0.0 and 1.0
n-by-m-by-3 array of RGB values that
defines a truecolor image displayed
on either a push button or toggle
button.
HandleVisibility on, off. Default is on. Determines if an object's handle is
visible in its parent's list of children.
For toolbars and their tools, set
HandleVisibility to off to
protect them from operations not
intended for them.
Separator off, on. Default is off. Draws a dividing line to left of the
push tool or toggle tool
State off, on. Default is off. Toggle tool state. on is the down, or
depressed, position. off is the up,
or raised, position.
Tooltip Character vector or
string scalar
Text of the tooltip associated with
the push tool or toggle tool.
For a complete list of properties and for more information about the properties listed in
the table, see the Uitoolbar, Uipushtool, and Uitoggletool.
Toolbars
The following statements add a toolbar to a figure, and then add a push tool and a toggle
tool to the toolbar. By default, the tools are added to the toolbar, from left to right, in the
order they are created.
% Create the toolbar
fh = figure;
tbh = uitoolbar(fh);
% Add a push tool to the toolbar
a = [.20:.05:0.95];
img1(:,:,1) = repmat(a,16,1)';
img1(:,:,2) = repmat(a,16,1);
img1(:,:,3) = repmat(flip(a),16,1);
pth = uipushtool(tbh,'CData',img1,...
'Tooltip','My push tool',...
9 Lay Out a Programmatic UI