Question

Firefox add-on. For some reasons, I wish to orient listbox entries horizontally. By default they are oriented vertically. For eg: I have this code

<listbox id="myList">
  <listitem label="A"/>
  <listitem label="B"/>
  <listitem label="C" selected="true"/>
</listbox>
  • orient attribute doesn't work on the listbox element
  • I can orient the elements horizontally if I wrap the listitems in an hbox. But that is not a standard approach and would result in wrong selectedIndex etc.
  • I experimented with richlistbox as well, but doesn't help.

So is there a way to orient listbox elements horizontally ?

Was it helpful?

Solution

Using the approach you suggested (hbox) renders the selectedIndex property unusable but selectedItem still works!

<listbox id="myList" onselect="(this.selectedItem.label='x')">
  <hbox style="">
    <listitem label="Aaa"/>
    <listitem label="Bbbb"/>
    <listitem label="Ccccc"/>
  </hbox>
</listbox>

Or how about using a toolbar:

<toolbar style="-moz-appearance:groupbox" flex="0">
  <toolbarbutton type="radio" group="xxx" label="a"/>
  <toolbarbutton type="radio" group="xxx" label="b"/>
  <toolbarbutton type="radio" group="xxx" label="c"/>
</toolbar>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top