Toolbar possibilities

Hi All,

I dynamically/programmatically created toolbars and toolbar items in XCode 2 (using AppleScript). They were limited to click buttons with icons. In XCode 3 (including Interface Builder 3) we can drag just about any control into toolbars. Some questions:

  1. If I create a toolbar using IB3, can I deploy that app in Tiger (and previous versions) or will it only run in Leopard? Is this limit for all XCode 3 projects, or just those made with AppleScript?

  2. Is there a programmatic way to add the new interface objects (eg stepper, text field) to the toolbar, as we can for buttons? If not pure AppleScript then how about using a call method? Will these items also carry over on pre-Leopard deployments (in the same way as programmatically created toolbar buttons do)?

  3. I managed to get a stepper working in a toolbar. When I click on it, my app gets a “clicked” event and a reference to the object, from which I can get the name. But when I try a slider, a text field, a search field I get an error like “AppleScript Error: Can’t make <> id 612 into type reference. (-1700)”. Are there objects other than buttons and steppers that work? Is there a way to get other objects (such as sliders, search field) to work, even using “call method” if necessary?

Thanks,
Tom
BareFeet

Hi barefeet,

I can only answer your first question:

NSToolbar, the toolbar you can add in the new Interface Builder, will only work in Leopard, apparently.

If you add a toolbar with IB, click on “Info” in Interface Builder and then choose any OS X version below 10.5 in the “Deployment Target” popup you will see this message:

Toolbar - Class Unavailable - NSToolbar is not supported in NIB/XIB files on Mac O X versions prior to 10.5

See the “update” at the bottom of my posting about this here with more links to related issues with the new NSToolbar
http://foolsworkshop.com/applescript/2008/05/add-a-toolbar/

Best,

K. M. Lawson