Okay, I think that this might be a weird one.  I've read the documentation, and 
I've implemented a toolbar for my document based application.  For the most 
part, it works perfectly but its settings don't seem to be getting saved.  

For example:
1. If I have x many windows open and I add an item to the tool bar of one of 
the windows then the toolbar of all of the windows will be updated correctly 
(as I expect)
2. If I then open another document window then that window will contain the 
default set of items only, and not the additional item that I added in the last 
step.
3. If I then add the item to the window that I just opened it will have one 
instance of the item, and all the other windows will have two instances of the 
item.
4. If I then quit the application and reload it, all windows will return to 
having the default set of items only.

Clearly, this behaviour (except step 1) is wrong.  Can anyone suggest what I 
might have messed up?

My tool bar settings are as follows:
    [toolbar setAllowsUserCustomization:YES];
    [toolbar setAutosavesConfiguration:YES];
    [toolbar setDisplayMode:NSToolbarDisplayModeIconOnly];
    [toolbar setDelegate:self]; //I suspect that this might not be needed


I have implemented the following (as per the documentation):
- (BOOL) validateToolbarItem: (NSToolbarItem *) toolbarItem
- (NSToolbarItem *)toolbarItemWithIdentifier:(NSString *)identifier
                                       label:(NSString *)label
                                 paleteLabel:(NSString *)paletteLabel
                                     toolTip:(NSString *)toolTip
                                      target:(id)target
                                 itemContent:(id)imageOrView
                                      action:(SEL)action
                                        menu:(NSMenu *)menu
- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString 
*)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag
- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar *)toolbar
- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar

For any help you can offer, I am most grateful!
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to