2
votes

I'm attempting to create a custom display in the toolbar similar to the info pane in the center of Xcode's toolbar.

How can we create an NSToolbarItem wider than 32 points?

The framework always restricts it to 32 points even if both, min and max size are greater than that.

I've tried a number of things - including setting the width to flexible as indicated by the docs by using different min and max width settings (no effect), assigning an image wider 32 points (gets scaled down), implementing a custom NSToolbarItem with a custom view setting the view, view's frame and toolbar item's max. size from code (no effect).

Any hints on how to enable toolbar items wider than the 32 point limitation?

1

1 Answers

1
votes

Sounds like a bug to me. Workaround: implement minSize.

- (NSSize)minSize {
    return NSMakeSize(256.0, 16.0);
}