NSToolbarItem — Mac OS X 10.0
This class represents the controls that populate toolbars in the user
interface. By default, a toolbar item is an icon with a label
attached. This icon functions as as simple button. Like instances of
NSButton
, an NSToolbarItem
object sends an action message to a target when the user clicks the
item. To initialize a toolbar item, we use the method
initWithItemIdentifier
:. The identifier is simply
a string used to uniquely identify the toolbar item. AppKit has a
number of prebuilt toolbar items that are used for common tasks, such
as opening the color panel or starting a print job. To take advantage
of these standard toolbar items, initialize the toolbar item with one
of the identifier strings listed in the constants herein.
The second type of toolbar item is a custom NSView
assigned to the toolbar item. The method setView
:
can be used to create a view in Interface Builder (or
programatically) with a small set of controls suitable for a toolbar,
and then create a toolbar item out of this view. This allows you to
put standard AppKit controls (such as sliders or radio buttons) in
the toolbar.