User`s guide
11 Lay Out a Programmatic GUI
img1(:,:,1) = repmat(a,16,1)'
img1(:,:,2) = repmat(a,16,1);
img1(:,:,3) = repmat(flipdim(a,2),16,1);
pth = uipushtool(th,'CData',img 1,...
'TooltipString','My push tool',...
'HandleVisibility','off')
% Add a toggle tool to the toolbar
img2 = rand(16,16,3);
tth = uitoggletool(th,'CData',i mg2,'Separator','on',.. .
'TooltipString','Your toggle tool' ,...
'HandleVisibility','off')
fh isthehandleoftheparentfigure.
th isthehandleoftheparenttoolbar.
CData is a 16-by-16-by-3 array of values between 0 and 1. It defines the
truecolor image that is displayed on the tool. If your image is larger than 16
pixels in either dimension, it may be clipped or cause other undesirable effects.
If the array is clipped, only the center 16-by-16 part of the array is used.
Note Create your own icon with the icon editor described in “Icon Editor” on
page 15-63. See the
ind2rgb reference page for information on converting
amatrix
X and corresponding colormap, i.e., an (X, MAP) image, to R GB
(truecolor) format.
11-90