Re: NSToolbar settings not saved
Re: NSToolbar settings not saved
- Subject: Re: NSToolbar settings not saved
- From: Michael Starke <email@hidden>
- Date: Fri, 09 Aug 2013 15:34:51 +0200
I'm using a similar setup, that is I allocate and place the toolbar in code, create all toolbar items with the delegates.
I'm supporting the same delegates as you do (defaults, allowed) and do not get the described behavior.
1. Same here
2. New window has custom toolbar as I did modify it
3. Not valid, see 2.
4. After restart I get the custom toolbar configuration
So to sum it up, my behaviour is exactly as expected not like the one you're describing.
- Michael
On 09.08.2013, at 13:22, Pax <email@hidden> wrote:
> 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 (email@hidden)
>
> 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:
>
> This email sent to email@hidden
___m i c h a e l s t a r k e____
geschäftsführer
HicknHack Software GmbH
www.hicknhack-software.com
___k o n t a k t____
+49 (170) 3686136
email@hidden
___H i c k n H a c k S o f t w a r e G m b H____
geschäftsführer - maik lathan | andreas reischuck | michael starke
bayreuther straße 32
01187 dresden
amtsgericht dresden HRB 30351
sitz - dresden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden