Using Bongo

Bongo is used to create user interfaces which we call Presentations. These presentations are stored in a file with the .gui extension. The stored presentations can be executed (played) independently or they can be incorporated into Java programs. See the programming documentation for more information. See the tutorial to learn more about presentations and Marimba Bongo.

You will notice that most of the Marimba software is built using Bongo.


Starting Bongo

To start Bongo double click on the Bongo icon or on Solaris execute the bin/bongo program. The Bongo window will become visible.


Loading Demo Presentations

The release contains several demo presentations in the demo/examples directory. You can load these demo presentations by selection Open Presentation from the File menu. You can also open presentations by passing them as an argument to the bongo command. Bongo stores presentations (User Interfaces) in a Presentation file.

On Windows you also have to option to right-click the mouse on a Presentation file icon in the file browser and select the Edit option from the menu. Note that if you simply double click on the icon a player for the presentation is launched instead.


Creating a new Presentation

You can create a new presentation by selecting New Presentation from the File menu. A copy will be maded of the untitled.gui presentation.

On Windows you also have the option to right-click in the desktop background and select Marimba Presentation from the New menu.


Editing/Browsing a Presentation

Once you have created or opened a Presentation you can switch between browse mode and edit mode. You can do this by typing Esc to exit edit mode and by clicking the mouse while holding down the control key to enter edit mode.
You can also switch modes by selecting Edit or Browse from the File menu.


Containers

While in edit mode you will see a yellow and black dashed outline surrounding the container which you are currently editing. You can only manipulate widgets inside the selected container. To select another container Control-Click on the component you want to manipulate. This will make the component's container the current container and will select the desired component.


Editing Widgets

You can add a widget to the currently selected container by selecting a widget from the New menu. Once you have selected a widget the Bongo window will switch to the property page.

You can add a custom widget by selecting New Widget... from the New menu.
Make sure that your custom widget class extends marimba.gui.Widget !

You can edit most widgets in-place. To edit a widget in-place Control-Click on the widget or select Edit from the File while the desired widget is selected.


Editing Properties

You can change a widget's properties in the property page. The properties reflect the properties of the selected widget. You can change the properties and press the Apply button to apply the new properties to the selected widget.


Editing Folders

You can add a Folder to the current container by selecting New Folder from the Folder menu. After you have created a folder, select the current page by control clicking in the folder. You can add pages by selecting New Page from the menu.

To flip pages use the page up/down function keys while the folder is selected. You can assign titles (tabs) to the pages by editing the title property of each page.


Controlling layout

The current version of Bongo uses a simple layout mechanism. You can attach the north/south/eash/west edges of a widgets to the corresponding edge of its container. This is done by double clicking on the appropriate resize handle. The edge is attached if the handle is colored red.

Note that a widget that is attached to two opposite edges will be stretched accordingly when the parent container is resized.


Scripting

Currently we allow you to script widgets using Java. When you add a script to a Widget, this means that a sub-class of that Widget is created. You can override existing methods to change behavior, call the original methods using the super keyword and add new methods. Those new methods can only be called from the Widget itself; you cannot access the script from another Widget because it is an unnamed sub-class. In addition to scripting widgets in Java we will be adding a higher level scripting language.
Try entering the script you see at the right for a button widget. This will override the existing paint method and only draw a diagonal line.

To access classes other than the standard marimba classes from a script you have to define the marimba.import property in your properties file in the .marimba directory in your home directory. This is a temporary work around.


Resources

Some widgets such as the ImageWidget and the AudioWidget use external resources. These are accessed by looking in the same directory as the presentation. Use relative file names or absolute URLs.

Note that as you copy and paste widgets the URLs used by the widget may be modified to reflect the new relative location of the resource.