Is there an easy method (declare or MBS) to make the toolbar customizable? I’ve seen the full example from MBS. But for this I would have to completely redo my toolbar, which I don’t want to do if possible.
you can use NSToolbar stuff from Apple (e.g. via Plugin classes) and have the customization palette automatically.
But not easily with the built in, I think.
The code from this thread will allow you to get the contextual menu on the toolbar, but the only option available in the customize sheet is the default toolbar…
Well, i have to add that on Mac you can get the NSToolbarMBS object for the toolbar.
But I have no idea how Xojo internally builds the toolbar.
It’s easy to allow the customer to customize your toolbar, but it does mean that you need to write some code to store what buttons are where and then reload them. You’d probably then want to create the toolbar in code rather than using the toolbar editor.
In all honesty, we used to worry about customizing the toolbar, but found that no-one cared when we upgraded to Cocoa and this function wasn’t available.
I thought if you used NSToolbar and the customer used the native customize toolbar option position saving was taken care of automagically.
If you manually create a NSToolbar then yes (but that requiring using declares or plugins to do so and is OS X only). If you want to stick to the Xojo toolbar and want this functionality, then you need to again manually create the toolbar (it still requires declares to enable the OS customization panel).
If you use the Xojo toolbar designer (which makes it real easy to layout a toolbar), then you’re out of luck (at least in my tests).
Thanks for the information! I think I’ll then change to the MBS plugin functions.