a few days ago, Greg0 posted
For anyone looking for a native macOS toolbar, I made one available on the Xojo store recently. You can find more information and a demo link on my website.
Reading time: 1 mins 🕑
Likes: 8 ❤
A few years ago I had written a basic toolbar control for Swift and Gregs post on TOF inspired me to revisit mine and make it a more robust control.
So if you have a need for a NSToolbar class for Swift let me know.
supports standard toolbar buttons with either/both Images and Text
supports both SPACE and FLEXSPACE items
supports all the system toolbar items (Print, Colors, Font, Cloud etc)
supports grouped controls with either Icons or Text
supports a Searchbar
supports a Dropdown Button type
supports adding almost any macOS Control that is inherited from NSView (which is most of them)
Written in 100% Swift.
nice to see alternatives in other languages posted
Newest version supports SF Symbols as well as PNG images for all toolbar icons
this is the same code as above, but with all SF Symbols instead.
I have added a “commandBar” to this package, it is a custom control similar to a NSToolbar, but is icons only. supports the same icon syntax (SF or PNG), and have overflow ability incase the control is not wide enough for all the buttons… It supports “space” and “flexspace” entries, the rounded borders are computed automatically based on the space entry locations
This example attempts to duplicate the similar control in the Xojo IDE using SF. but the icons are not exactly matching