Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Recent issues

Article Preview

Buy Now

Issue 2.5


MaxiToolbar Pro

Issue: 2.5 (May/June 2004)
Author: Marc Zeedar
Article Description: No description available.
Article Length (in bytes): 4,068
Starting Page Number: 8
Article Number: 2503
Related Web Link(s):


Full text of article...

So you've just finished your fantastic REALbasic application, designed with an attractive Mac OS X toolbar. When you go to compile, it hits you: RB's Mac OS X toolbar support doesn't work under Windows or Mac Classic. What are you going to do?

The answer is MaxiToolbar Pro (MTP for short). Formerly sold as Toolbar Buttons Pro by Everyday Software, MTP has been acquired and updated by Electric Butterfly.

MaxiToolbar Pro is a collection of classes for REALbasic that allows you to create a toolbar that works in Mac OS X, Mac Classic, and Windows. The toolbar looks and functions just like standard Mac OS X toolbars, including menu buttons, icon mode (icon and text, icon only, text only), and button wrap (a submenu appears on the right when the toolbar display isn't wide enough to show all the buttons). The toolbar looks almost exactly the same under Windows and Mac Classic, so you don't have to redesign anything. The current release of MTP doesn't support a "small icons" mode, nor does it allow the user to reconfigure the toolbar.

Additional features such as help tags and contextual menus within the toolbar are also supported. New with version 1.3 is a "flexible spacer" button type which shifts your final button to the far right of a toolbar (like the "burn" button in iTunes).

Using MTP is not difficult, but it could be easier. There are several classes that must be imported into your project and the manual warns that due to the way REALbasic handles cross-linked classes, you must import them in a certain order. This adds several steps to what should be a simple process. It would have been better to name the classes in such a way that they import in the correct order.

After the classes are in your project, you place a series of canvas objects on your window to represent your toolbar. You simply set each canvas to a particular class (for instance, a toolbar, a button, a menu button, a separator, etc.).

Then you must add some initialization code to each button (link the correct icon to the button, install the button's label and help tag, etc.). The most important is setting each button's itemIndex property to a number that indicates the order the button appears on the toolbar. On a multi-button toolbar I got confused and had a couple buttons numbered incorrectly and the toolbar didn't work right at all.

None of this is difficult, but it's easy to make mistakes. While the example project shows you how to code the toolbar, since RB can't open two projects at once it'd be nice if this code were available within the imported classes somewhere (i.e., inside a notes field).

Minor learning curve aside, if you want to create a Mac OS X-style toolbar and use it in all versions of your application (Classic and Windows), you'll be happy with MTP.

End of article.