Add Navigation Buttons to NSTouchBar
Xcode and Safari sport Touch Bar items to navigate back and forth. Have a close look: When you put two NSTouchBarItem
s next to each other, there usually is a gap. Between the navigation controls, there is a mere hairline divider, but not the regular fixed-width space. They are not realized via NSSegmentedControl
, though. Compare the navigation buttons with the system-wide controls far to the right: volume, brightness, play/pause. (I’m listening to the 1980s Pop Radio on Apple Music at the moment, in case you’re curious.) The system controls are a NSSegmentedControl
. They have rounded corners for the whole control, while the navigation buttons have rounded corners for every button. Also, the navigation buttons have the default button width.
Fix NSSegmentedControl Action Forwarding from Your NSToolbar

Two years ago, I wrote about how I implemented a toolbar with NSSegmentedControl
, much like Apple’s own apps have them since macOS 10.11 Yosemite. Last week I discovered my implementation was buggy: it did not work at all when you customize the toolbar to show “Icon Only”, i.e. hide the label text.
Disabling Segments in a NSSegmentedControl in a Toolbar
This post is part of a series on getting NSSegmentedControl
to work in your toolbars. Earlier this week I posted how to create a segmented toolbar item with 1 label for each segment. Now some options in TableFlip depend on context: without a selected cell, you cannot remove the selection, for example. So I disabled some segments and it looked alright:
How to Create a Segmented NSToolbarItem like Apple Mail.app

Ever wondered how Apple Mail’s NSToolbar
achieves the effect of individually labeled buttons shown in groups? Update 2018-11-23: I discovered a flaw in the target–action-mechanism of NSToolbarItem
s. They don’t fire if the label is hidden. This post’s approach is still valid enough, but is now part of a series of posts on the topic, with the 3rd one providing a fix: