An Introduction to XUL Part 2 - Organizing Buttons (Page 2 of 6 )
There is also an easily coded way of placing buttons automatically into a horizontal toolbar that sits near the top of the page:
<toolbox>
<toolbar id="tool1">
<toolbarbutton label="Back"/>
<toolbarbutton label="Forward"/>
</toolbar>
</toolbox>
The toolbar should reside within a toolbox and to make use of the functionality of the collapse/expand arrow (known as a grippy) at the far left of the toolbar, the id attribute should always be used with the <toolbar> element.
Those used to HTML will find the form-like elements of XUL very easy to get to grips with; XUL offers all of the standard form elements such as radio buttons, checkboxes, drop-down or combo boxes and text fields, which are known as controls. The following code illustrates the use of these controls:
<checkbox label="I am a checked checkbox!" checked="true"/>
<checkbox label="I am also a checkbox but am not checked yet!"/>
<radiogroup>
<radio label="I am a selected radio button!" selected="true"/>
<radio label="I am also a radio button but am not selected yet!"/>
</radiogroup>
<menulist>
<menupopup>
<menuitem label="I am a drop-down box selection!" />
<menuitem label="I am also a drop-down box selection!"/>
</menupopup>
</menulist>
<textbox id="input"/>
This should be added below the existing button code, and upon execution, you will find these controls below your buttons.
Next: Changing Textbox Attributes >>
More XML Articles
More By Dan Wellman