XBL



         


XBL or eXtensible Bindings Language is used to declare the behavior of XUL widgets. In XUL one defines the user interface layout of an application, and then (applying styles) can customize the look of elements. The drawback is that XUL provides no means to change an element's function. For example, one might want to change how the pieces of a scroll bar work. This is where XBL comes in.

An XBL file contains bindings. Each of them describes the behavior of a XUL widget. For example, a binding might be attached to a scroll bar. The behavior describes the properties and methods of the scroll bar and describes the XUL elements defining the scroll bar.

The root element of an XBL file is the <binding> element. Each <binding> element declares one binding, which can be attached to any XUL element. It also may have an id attribute. A binding is assigned to an element by setting the CSS property -moz-binding to the URL of the bindings file. For example:

scrollbar {

-moz-binding: url('somefile.xml#binding1');

}

where #binding1 is the id of the binding.

[Top]




  View Live Article   This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License