NSToolbar

NSToolbar Mac OS X 10.0

This class manages a toolbar in an application window. Every toolbar has an identifier, and multiple toolbars in an application with the same identifier (say, in multiple open document windows) will keep the same state. Toolbar objects take a delegate that provides the toolbar with NSToolbarItems to populate the toolbar and the toolbar customization sheet.

figs/cocn_15111.gif

@interface NSToolbar : NSObject
 // Initializers
   - (id)initWithIdentifier:(NSString *)identifier;
 // Accessor Methods
   - (void)setConfigurationFromDictionary:(NSDictionary *)configDict;
   - (void)setDelegate:(id)delegate;
   - (id)delegate;
   - (void)setVisible:(BOOL)shown;
   - (void)setAllowsUserCustomization:(BOOL)allowCustomization;
   - (BOOL)allowsUserCustomization;
   - (void)setDisplayMode:(NSToolbarDisplayMode)displayMode;
   - (NSToolbarDisplayMode)displayMode;
   - (void)setSizeMode:(NSToolbarSizeMode)sizeMode;
   - (NSToolbarSizeMode)sizeMode;
   - (void)setAutosavesConfiguration:(BOOL)flag;
   - (BOOL)autosavesConfiguration;
 // Instance Methods
   - (NSDictionary *)configurationDictionary;
   - (NSString *)identifier;
   - (BOOL)customizationPaletteIsRunning;
   - (void)insertItemWithItemIdentifier:(NSString *)itemIdentifier atIndex:(int)index;
   - (BOOL)isVisible;
   - (NSArray *)items;
   - (void)removeItemAtIndex:(int)index;
   - (void)runCustomizationPalette:(id)sender;
   - (void)validateVisibleItems;
   - (NSArray *)visibleItems;
// Methods Implemented by the Delegate
   - (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier
        willBeInsertedIntoToolbar:(BOOL)flag;
   - (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar;
   - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar;
   - (void)toolbarDidRemoveItem:(NSNotification *)notification;
   - (void)toolbarWillAddItem:(NSNotification *)notification;
// Notifications
   NSToolbarDidRemoveItemNotification;
   NSToolbarWillAddItemNotification;



    Part II: API Quick Reference
    Chapter 13. Foundation Classes