0
votes

I'm building a Mac OS X app. I just tried to set a toolbar button to show/hide a toolbar on NSWindow's title bar. But it doesn't do anything for me. Initially I tried to achieve that with the checkbox in the interface builder.

Toolbar button I expected here is below.

Toolbar Button to toggle the toolbar

I tried the checkbox in the interface builder to get the button like below.

Toolbar button checkbox

I thought it could be no longer available in the latest El Capitan, then tried it with Xcode 4.6 on Lion but I could not see the button, neither.

I found the following page to explain how to add a button to the title bar on this site.

How to use NSTitlebarAccessoryViewController?

And I could manage to do that by myself. But I'm still wondering if there is a way to use the default button. Any suggestions would be appreciated.

1

1 Answers

0
votes

I am pretty sure Apple dropped the toolbar button with OS X Lion. I assume the checkbox is only there for older versions. (Snow Leopard and earlier)

Adding your own button using NSTitlebarAccessoryViewController is a good idea!