I’m doing my first steps in MacRuby. Does anyone know how I can add a custom Toolbar to my Cocoa/MacRuby application, which will accept “regular” items for e.g. switching the view (see http://www.stevestreeting.com/wp-content/uploads/2011/06/SelectableToolbarDemo001.png).
I’ve read some tutorials and I guess I have to create a custom delegate for the Toolbar and then connect it via the Outlets window, but how does the myCustomDelegate.rb have to look like?
There is an excellent tutorial here: http://www.mere-mortal-software.com/blog/details.php?d=2007-03-14
It is targeted at preferences windows, but of course you could use the window class anywhere.
I have not bothered to port the window superclass to Macruby, I just use it as is. Then I use macruby to write the subclass, for example:
The one thing that might cause me to some day port the window class to macruby is to give it the ability to have a bottom section that appears on all panes.