Note that there are some explanatory texts on larger screens.

plurals
  1. PONSButton in NSToolbarItem (setView) when clicked in "Text only" forces mode to "Icon and Label"
    primarykey
    data
    text
    <p>I am trying to recreate the nice textured buttons like Finder, Safari and Transmission have in their toolbar. First I started by just dragging in a "Texture button" in the IB and such. All works well except for when a user sets the toolbar to "Text only" mode. When he then clicks the button the toolbar will enable "Icon and Label" on it's own. I have remove alles code and delegates from the toolbar to make sure it is not a code issue.</p> <p>Then, just to make sure, I created a new project (no code at all) and I can reproduce the issue with a clean NSWindow with a NSToolbar with one NSToolbarItem with a NSButton in it.</p> <p>Adding the NSButtons via code like:</p> <pre><code>- (NSArray*)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar { return [NSArray arrayWithObject:@"myToolbarMenu"]; } - (NSArray*)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar { return [self toolbarAllowedItemIdentifiers:toolbar]; } - (NSToolbarItem*)toolbar:(NSToolbar*)toolbar itemForItemIdentifier:(NSString*)str willBeInsertedIntoToolbar:(BOOL)flag { if ([str isEqualToString:@"myToolbarItem"] == YES) { NSToolbarItem* item = [[NSToolbarItem alloc] initWithItemIdentifier:str]; [item setView:[[NSButton alloc] init]]; [item setMinSize:NSMakeSize(50,50)]; [item setMaxSize:NSMakeSize(50,50)]; [item setLabel:@"Text"]; return [item autorelease]; } return nil; } </code></pre> <p>But this also has the same effect: when I press a NSToolbarItem with a NSButton in it in "Text only mode" the toolbar itself forces it's mode to "Icon and Text".</p> <p>Do you have any idea how I can make it work correctly or perhaps have an alternative to creating the nice looking toolbaritems like Safari etc have?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload