Create Toolbars for Programmatic Apps
In this section...
“Use the uitoolbar Function” on page 9-51
“Commonly Used Properties” on page 9-51
“Toolbars” on page 9-52
“Display and Modify the Standard Toolbar” on page 9-55
Use the uitoolbar Function
Use the uitoolbar function to add a custom toolbar to your UI. Use the uipushtool
and uitoggletool functions to add push tools and toggle tools to a toolbar. A push tool
functions as a push button. A toggle tool functions as a toggle button. You can add push
tools and toggle tools to the standard toolbar or to a custom toolbar.
Syntaxes for the uitoolbar, uipushtool, and uitoggletool functions include the
following:
tbh = uitoolbar(fh,'PropertyName',PropertyValue,...)
pth = uipushtool(tnh,'PropertyName',PropertyValue,...)
tth = uitoggletool(tbh,'PropertyName',PropertyValue,...)
The output arguments, tbh, pth, and tth are the handles, respectively, of the resulting
toolbar, push tool, and toggle tool. See the uitoolbar, uipushtool, and
uitoggletool reference pages for other valid syntaxes.
Subsequent topics describe commonly used properties of toolbars and toolbar tools, offer
a simple example, and discuss use of the MATLAB standard toolbar:
Commonly Used Properties
The most commonly used properties needed to describe a toolbar and its tools are shown
in the following table.
Create Toolbars for Programmatic Apps