Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

<binding display="..."/> - what does that mean?

0 views
Skip to first unread message

Alex Vincent

unread,
Jan 28, 2009, 2:20:27 AM1/28/09
to
From
https://developer.mozilla.org/en/XBL/XBL_1.0_Reference/Elements#binding:

"This attribute specifies how the tag is displayed. By setting this
attribute, you can have an element have the layout and display
characteristics of an existing element. For example, use the value
'xul:button' to create an element that is displayed like a button."

I have no idea what that means - specifically, the "layout and display
characteristics" part.

The example I'm looking at is the columnpicker binding in
http://mxr.mozilla.org/mozilla-central/source/toolkit/content/widgets/tree.xml

What does the display attribute influence? Can someone write up a
couple XUL examples to demonstrate the difference?

Neil

unread,
Jan 28, 2009, 5:42:08 AM1/28/09
to
Alex Vincent wrote:

> What does the display attribute influence?

Many XUL elements have built-in behaviour. Buttons fire command events
when you click them, while decks allow you to flip "cards". How this is
achieved depends on the element. Some elements, such as textbox, are
simply constructed from other elements, with some XBL providing
properties and methods. Some, such as stack and deck, use CSS to direct
the CSS frame constructor to create the special behaviour. Other
elements, such as button and menu, have their tag names hardcoded into
the CSS frame constructor. This of course makes it difficult to create
new widgets using that behaviour. This is where the display attribute
comes in. It directs which behaviour is used. You can even make a button
behave like a menu, thus producing a menubutton.

Note that if your binding does not already extend another binding then
you have to use extends instead of display.

--
Warning: May contain traces of nuts.

0 new messages