43.1 Overview

Statusbar class creates a widget placed at the bottom of the window to give small amounts of status information. Status bars contain one or more children of Statusbaritem class, all of which can be either of fixed or variable lengths.

When creating a status bar in XML, you have to specify how many fields it should get by using the <item> tag to add children of Statusbaritem class to your status bar. Here is an example of a status bar with three fields:

 
<statusbar>
   <item id="first">Welcome to my application</item>
   <item id="second"/>
   <item id="third" width="20"/>
</statusbar>

You can set the widths of the individual fields using the Statusbaritem.Width attribute. Above we assign a fixed width only to the third field. The other two use variable widths.

The text of status bar items can be changed later by setting the Statusbaritem.Text attribute. Note, however, that this often isn't even necessary because the text provided in the Menuitem.Help and Toolbarbutton.Help attributes is automatically shown in the status bar and doesn't require any additional code on your part.

There can be only one status bar per window and it always has to be the last child of the window's root group. RapaGUI won't accept status bars at random positions in the GUI layout. Status bars must always be the last child of the window's root group. Thus, they are always placed at the bottom of the window layout.

Also note that it is not possible to create stand-alone instances of this class using moai.CreateObject(). Status bars always have to be created within the context of a window. Thus, if you want to create status bars using moai.CreateObject(), you always have to create a complete window and embed the status bar in this window declaration.

Statusbar class doesn't define any attributes or methods itself. See Statusbaritem class for all necessary information.


Show TOC