10

I'm trying to add a textured rounded button to NSToolbar. I used Interface Builder to add NSButton to allowed toolbar items and default items.

I'm using Safari-style toolbar with window!.titleVisibility set to .hidden.

Xcode 8 prints this error message:

NSToolbarItem (<NSToolbarItem: 0x100c24000>) had to adjust the size of
<NSButton: 0x100c36690> from {43, 25} to {45, 27} as the height is expected to be
27.000000. Make sure that this toolbar item view has a valid frame/min/max size.

This worked for me in previous OS X releases.

I tried setting min and max toolbar item height to 27, but Xcode automatically reverts min to 25.

egor.zhdan
  • 4,555
  • 6
  • 39
  • 53
  • Can you please file a bug at bug report.apple.com, and if possible attach a sample project and screenshots? Does building with Xcode 7.x behave differently on the same macOS version? – Quinn Taylor Jun 23 '16 at 01:52
  • 1
    @QuinnTaylor yeah I submitted a radar (id: 26972329) and attached a sample project and a screenshot. I'm not able try it with Xcode 7 at the moment, will update the issue a bit later. – egor.zhdan Jun 23 '16 at 13:11
  • 1
    Thanks! This appears to be a new warning when linking against the Sierra SDK, but the issue it's reporting has existed before. We'll look into it. – Quinn Taylor Jun 24 '16 at 23:51
  • I just started linking with Sierra SDK today and got what seems to be the same warning, but claims to be app bug: NSToolbarItem () had to adjust the size of from {30, 25} to the expected size of {32, 27}. Make sure that this toolbar item view has a valid frame/min/max size. This is an app bug, please do not file a bug against AppKit or NSToolbar! Break on _NSToolbarAdjustedBorderedControlSizeBreakpoint – Chuck H Sep 23 '16 at 04:28
  • Same issue here, Xcode 8 did not show this issue under El Capitan when using the 10.12 SDK. So it's Sierra related. – Nightbirdsevolve Sep 30 '16 at 10:12
  • Possible duplicate of [NSToolbarItem: "Make sure this toolbar item has a valid frame/min/max size"?](http://stackoverflow.com/questions/39768476/nstoolbaritem-make-sure-this-toolbar-item-has-a-valid-frame-min-max-size) – Steven Green Oct 06 '16 at 14:58
  • Same issue here, Xcode 8 and Sierra. – Dalmazio Dec 10 '16 at 04:01

0 Answers0