XUL can only be used with the
Mozilla codebase (or a
fork of it) because the
Gecko (or
Goanna)
engine does the XUL rendering. Application programmers need to define a XUL interface as three discrete sets of components: • Content: the XUL document(s), whose elements define the layout of the
user interface • Skin: the CSS and image files, which define the appearance of an application • Locale: the files containing user-visible strings for easy
software localization XUL defines a wide range of elements, which roughly belong to the following types: • Top-level elements:
window, page,
dialog,
wizard, etc. •
Widgets: label,
button,
text box, list box,
combo box,
radio button,
check box,
tree,
menu,
toolbar, group box,
tab box, color-picker, spacer, splitter, etc. • Box model: box, grid, stack, deck, etc. • Events and scripts: script, command, key, broadcaster, observer, etc. • Data source: template, rule, etc. • Others: overlay, iframe, browser, editor, etc. The default behavior of XUL widgets can be altered with
XBL bindings.
XBL XML Binding Language (
XBL) is an
XML-based
markup language for altering the behavior of a XUL
widget, such as a
scroll bar. An XBL file contains
bindings, each of which describes the behavior of a XUL widget. The root element of an XBL file is the element, which contains one or more elements. Each element declares one binding, which can be attached to any XUL element. It may also possess an id attribute. A binding is assigned to an element by setting the CSS property -moz-binding to the
URL of the binding's file. For example: scrollbar { -moz-binding: url('somefile.xml#binding1'); }
Example This example shows three buttons stacked on top of each other in a vertical box container: ==
Ghostbusters reference ==