NSToolbar Questions
NSToolbar Questions
- Subject: NSToolbar Questions
- From: Dominik Wagner <email@hidden>
- Date: Tue, 28 Mar 2006 22:22:50 +0200
Hi there,
here is what I want to do:
- have many different NSToolbars for the same window
- change them on user demand (he changes the environment actively)
- these different toolbars have different sets of allowed and default
NSToolbarItems, and different identifiers
I switch toolbars by simply setting an new one the same way I set the
old one
NSToolbar *toolbar = [[[NSToolbar alloc]
initWithIdentifier:otherIdentifier autorelease];
[toolbar setAllowsUserCustomization:YES];
[toolbar setAutosavesConfiguration:YES];
[toolbar setDelegate:self];
[[self window] setToolbar:toolbar];
Everything works as expected despite the visible state: the new
toolbar is always visible although not respecting the setting of the
other toolbars with same identifier. If I open a new document which
has the same toolbar, the visible setting is respected. Any ideas how
I could influence/fix this?
I tried to first setToolbar:nil on the window and then
setToolbar:something again which totally screwed up when the new
toolbar should have been visible (the window consists solemny of an
floating toolbar, very cheesy :) )
I tried to setVisible:NO on the previous toolbar before exchanging
it, which had the obvious effect of setting the default visible state
for that kind of toolbar to NO which I didn't want. Then I triet to:
NSToolbar *previousToolbar = [[[[self window] toolbar] retain]
autorelease];
BOOL previousState = [previousToolbar isVisible];
[previousToolbar setVisible:NO];
[[self window] setToolbar:toolbar];
[previousToolbar setVisible:previousState];
remember the state and set it again afterwards, but this didn't work
because it seems that the configuration somehow only is maintained
and logged when the toolbar is displayed in an actual window.
Thats also the reason that newly created toolbars always return
isVisible:NO if they aren't in a window, i think. Which prevents me
of doing other workarounds.
So what can I do?
On a sidenote: I would also like to make all of my different toolbars
to share the same displayMode, although they have different item
orders and itemsets.
I'm glad for any help,
Dominik
--
Dominik Wagner Mail: email@hidden
TheCodingMonkeys http://www.codingmonkeys.de/
Blog - DasGenie: !Scrap http://scrap.dasgenie.com/
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden