uitoolbar

Create toolbar on figure

Use this function only with GUIDE, or with figures created using the figure function.

Syntax

t = uitoolbar
t = uitoolbar(Name,Value,...)
t = uitoolbar(parent)
t = uitoolbar(parent,Name,Value,...)

Description

t = uitoolbar creates a toolbar in an existing figure and returns the Toolbar object, t. If a figure does not exist, then MATLAB® calls the figure function to create one.

t = uitoolbar(Name,Value,...) creates a toolbar and specifies one or more Toolbar property name-value pair arguments. Use this syntax to override the default toolbar properties.

t = uitoolbar(parent) creates a toolbar in the specified parent figure.

t = uitoolbar(parent,Name,Value,...) specifies a parent figure for the toolbar and one or more name-value pair arguments.

Examples

This example creates a figure containing an empty toolbar.

f = figure('ToolBar','none')
t = uitoolbar(f)

Tips

Toolbar objects do not appear in figures whose WindowStyle property is set to 'Modal'. If a figure containing a toolbar child is changed to 'Modal', the toolbar child still exists in the Children property of the figure. However, the toolbar does not display while WindowStyle is set to 'Modal'.

Introduced before R2006a