User`s guide
Create Toolbars for Programmatic GUIs
Modify the Standard Toolbar
Once you have the handle of the standard toolbar, you can add tools, delete
tools, and change the order of the tools.
Add a tool the same way you would add it to a custom toolbar. The following
code retrieves the handle of the MATLAB standard toolbar and adds to the
toolbar a toggle tool similar to the one defined in “Toolbars” on page 11-89.
fh
isthehandleofthefigure.
tbh = findall(fh,'Type','uitoolbar ');
tth = uitoggletool(tbh,'CData', rand(20,20,3),...
'Separator','on',...
'HandleVisibility','off');
New toggle tool
To remove a tool from the standard toolbar, determine the handle of the tool
to be removed, and then use the
delete function to remove it. The following
code deletes the toggle tool that was added to the stan da r d too l ba r above .
delete(tth)
If necessary, you can use the findall function to determine the handles of
the tools on the standard toolbar.
11-93