id
: the id of the elementhidden
: true if the element is hiddenonmouseover
for mouse over events on XUL widgetsonmouseout
for mouse exit events on XUL widgetsclass
: the CSS style class of the elementstyle
: the CSS style of the elementdisabled
: true if the element is disabledoncommand
: the Javascript function to execute if the user execute an action on the elementoncommand
for command events on XUK widgets. Note that these events correspond to events sent by widget after the end of a change. Cntrary to the onchange
events, events sent before the end of a continuous change (such as the moving of a scale won't be sentonclick
for click events on XUL widgets. It will have the same result that "oncommand", for widgets which have click events (such as button)onchange
for change events on XUL widgets. In this case, events sent before the end of a continuous change will be sentonselect
for selection events on XUL widgetswidth
: the element widthheight
: the element heighttop
: the element position from its parent top corner. Only used if the parent is a stack elementleft
: the element position from its parent left corner. Only used if the parent is a stack elementwindow
element describes the top-level window. It must be the root of the XUL file.id
: the id of the elementhidden
: true if the element is hiddentitle
: the title of the windowwidth
: the width of the windowheight
: the height of the windowscreenX
: the X position of the window in the screenscreenY
: the Y position of the window in the screenresizable
: false if the window can't be resized[1]
orient
: the orientation of the window. Can be "horizontal" (the default) or "vertical"onload
sent for the window when the framework is started<window id="Test" title="Test XULScripts" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <button label="Yes"/> </window>The result is:
<window id="Test" title="Test XULScripts" orient="horizontal" onload="loaded()" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script> function loaded() { document.getElementById("theButton").label = "No"; } </script> <button id="theButton" label="Yes"/> </window>
stack
element displays interface controls at specified positions.id
: the id of the elementhidden
: true if the element is hiddentop
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementclass
: the CSS style class of the elementstyle
: the CSS style of the elementtop
and left
attributes.<stack> <button label="Goblins" left="5" top="5"/> <button label="Trolls" left="60" top="20"/> <button label="Vampires" left="10" top="60"/> </stack>The result is:
vbox
element is used to align interface controls vertically.id
: the id of the elementhidden
: true if the element is hiddenheight
: the height of the boxtop
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementclass
: the CSS style class of the elementstyle
: the CSS style of the element<vbox> <button label="Yes"/> <button label="No"/> <button label="Maybe"/> </vbox>The result is:
hbox
element is used to align interface controls horizontally.id
: the id of the elementhidden
: true if the element is hiddenwidth
: the width of the boxtop
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementclass
: the CSS style class of the elementstyle
: the CSS style of the element<hbox> <button label="Yes"/> <button label="No"/> <button label="Maybe"/> </hbox>The result is:
bbox
element is identical as hbox . It is used to align interface controls horizontally.
box
element is used to align interface controls horizontally or vertically. It works as the vbox
or hbox
elements.orient
: the orientation of the box. Can be "horizontal" (the default) or "vertical"id
: the id of the elementhidden
: true if the element is hiddenwidth
: the width of the box for horizontal boxesheight
: the height of the box for vertical boxestop
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementclass
: the CSS style class of the elementstyle
: the CSS style of the element<box orient="vertical"> <button label="Yes"/> <button label="No"/> <button label="Maybe"/> </box>The result is:
groupbox
element is used to group a labelled box around other user interface controls.id
: the id of the elementhidden
: true if the element is hiddentop
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementclass
: the CSS style class of the elementstyle
: the CSS style of the element<groupbox> <caption label="Answer"/> <description value="Banana"/> <description value="Tangerine"/> <description value="Phone Booth"/> <description value="Kiwi"/> </groupbox>The result is:
radiogroup
element is used to group a list of radio
buttons, only one being selected at a time.id
: the id of the elementhidden
: true if the element is hiddentop
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
element<radiogroup> <radio id="orange" label="Red"/> <radio id="violet" label="Green" selected="true"/> <radio id="yellow" label="Blue"/> </radiogroup>The result is:
tabbox
element is used to display a tabbed pane.selectedIndex
: the index of the selected tab (by default, it will be the first one). Remark that the first one has the index 1 and not 0id
: the id of the elementhidden
: true if the element is hiddentop
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementoncommand
: the Javascript function to execute if the user select a tabonchange
: the Javascript function to execute if the user select a tabtab
child for each tab, describing the label and/or icon of the tabtabpanel
child for each tab, describing the content under the tab<tabbox id="myTabList" selectedIndex="2"> <tabs> <tab label="A First tab"/> <tab label="Another tab"/> <tab label="Last tab"/> </tabs> <tabpanels> <tabpanel> <radiogroup> <radio id="orange" label="Red"/> <radio id="violet" label="Green" selected="true"/> <radio id="yellow" label="Blue"/> </radiogroup> </tabpanel> <tabpanel> <button label="Click me"/> </tabpanel> <tabpanel> <hbox> <groupbox orient="vertical"> <caption label="battery 1" /> <scale id="bat1" max="100" min="0" width="200" value="20" tooltiptext="scale"/> </groupbox> </hbox> </tabpanel> </tabpanels> </tabbox>The result is:
tabpanel
element specifies the component under a tab for the tabbox element.class
: the CSS style class of the elementstyle
: the CSS style of the elementtabpanels
element. it correspond to the associated tab
element for the tabbox
.<tabbox id="myTabList" selectedIndex="2"> <tabs> <tab label="A First tab"/> <tab label="Another tab"/> <tab label="Last tab"/> </tabs> <tabpanels> <tabpanel> ... </tabpanel> <tabpanel> ... </tabpanel> <tabpanel> ... </tabpanel> </tabpanels> </tabbox>
menubar
element is used to declare the menus which will be presented at the top of the window. This element must have menu
element children. <window id="Test" title="My Window" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menubar> <menu> ... </menu> </menubar> </window>
toolbox
is an empty container containing toolbars. It has no attributes.<window id="Test" title="My Window" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <toolbox> <toolbar id="nav-toolbar"> <toolbarbutton id="nav-users" label="Users"/> <toolbarbutton id="nav-groups" label="Groups"/> <toolbarbutton id="nav-events" label="Events" disabled="true"/> </toolbar> </toolbox> </window>
toolbar
element describes a toolbar. This element must be under a toolbox
element. id
: the id of the element<window id="Test" title="My Window" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <toolbox> <toolbar id="nav-toolbar"> <toolbarbutton id="nav-users" label="Users"/> <toolbarbutton id="nav-groups" label="Groups"/> <toolbarbutton id="nav-events" label="Events" disabled="true"/> </toolbar> </toolbox> </window>The result is:
toolbaritem
is a wrapper element which must be used on a toolbar to wrap elements different from toolbarbutton
. <window id="Test" title="My Window" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <toolbox> <toolbar id="nav-toolbar"> <toolbarbutton id="nav-users" label="Users"/> <toolbaritem> <textbox value="The text" cols="10"/> </toolbaritem> <toolbarbutton id="nav-events" label="Events"/> </toolbar> </toolbox> </window>The result is:
menu
element displays a menu at the top of the window.id
: the id of the elementlabel
: the label of the menudisabled
: true if the element is disabledmenupopup
element child. The items of the menu will be under this element<menubar> <menu label="Colors"> <menupopup> <menuitem label="Red"/> <menuitem label="Blue"/> <menuitem label="Yellow"/> </menupopup> </menu> </menubar>The result is:
menulist
element displays a combobox.id
: the id of the elementdisabled
: true if the element is disabledhidden
: true if the element is hiddenmenupopup
element child. The items of the menu will be under this element.<menulist> <menupopup> <menuitem label="Red"/> <menuitem label="Blue"/> <menuitem label="Yellow" selected="true"/> </lt;menulist> </menu>The result is:
label
element describes a label.id
: the id of the elementhidden
: true if the element is hiddenvalue
: the text of the labeltop
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementclass
: the CSS style class of the elementstyle
: the CSS style of the elementonmouseover
for mouse over eventsonmouseout
for mouse exit events<label id="mylabel" value="This is some text"/>
button
element describes a button.id
: the id of the elementhidden
: true if the element is hiddenchecked
: true if the button is checkeddisabled
: true if the element is disabledimage
: the image to use with the buttonlabel
: the text of the buttontype
: the type of the button. If the attribute is not present, the button will be a normal button. The other possible values are:checkbox
: for a toggle button[2]
radio
: for a radio buttonmenu
: for a menu buttontop
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementwidth
: the element widthheight
: the element heightclass
: the CSS style class of the elementstyle
: the CSS style of the elementoncommand
: the Javascript function to execute if the user click on the buttononclick
: the Javascript function to execute if the user click on the buttononmouseover
for mouse over eventsonmouseout
for mouse exit events<button label="PRESS ME!" oncommand="buttonPressed()" />The result is:
<button type="menu" oncommand="selected" > <menupopup> <menuitem label="List"/> <menuitem label="Details"/> </menupopup> </button>The result is:
toolbarbutton
element describes a button in a toolbar.id
: the id of the elementhidden
: true if the element is hiddenchecked
: true if the button is checkeddisabled
: true if the element is disabledimage
: the image to use with the buttonlabel
: the text of the buttonwidth
: the element widthheight
: the element heightclass
: the CSS style class of the elementstyle
: the CSS style of the elementoncommand
: the Javascript function to execute if the user click on the buttononmouseover
for mouse over eventsonmouseout
for mouse exit events<toolbar id="nav-toolbar"> <toolbarbutton id="nav-users" label="Users"/> <toolbarbutton id="nav-groups" label="Groups"/> <toolbarbutton id="nav-events" label="Events" disabled="true"/> </toolbar>The result is:
checkbox
element describes a checkbox.id
: the id of the elementhidden
: true if the element is hiddenchecked
: true if the checkbox is checkeddisabled
: true if the element is disabledimage
: the image to use with the checkboxlabel
: the text of the checkboxtop
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementclass
: the CSS style class of the elementstyle
: the CSS style of the elementoncommand
: the Javascript function to execute if the user click on the checkboxonclick
: the Javascript function to execute if the user click on the checkboxonmouseover
for mouse over eventsonmouseout
for mouse exit events<checkbox label="Yes" oncommand="buttonPressed()" />The result is:
radio
element describes a radio button.id
: the id of the elementhidden
: true if the element is hiddenselected
: true if the checkbox is selecteddisabled
: true if the element is disabledimage
: the image to use with the radio buttonlabel
: the text of the radio buttontop
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementclass
: the CSS style class of the elementstyle
: the CSS style of the elementoncommand
: the Javascript function to execute if the user click on the radio buttononmouseover
for mouse over eventsonmouseout
for mouse exit events<radio label="Yes" oncommand="buttonPressed()" />The result is:
textbox
element describes an editable textbox.id
: the id of the elementhidden
: true if the element is hiddendisabled
: true if the element is disabledvalue
: the text of the texboxrows
: the number of rows of text (default is one row)cols
: the number of columns of text (default is 20)multiline
: true for a multiline textwrap
: true for a wrapped text for multiline texttype
: the type of the textbox. The following values are supported:min
: the minimum value for a number editor (the default is 0)max
: the maximum value for a number editor (the default is 100)increment
: the increment step value for a number editor (the default is 1)top
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementclass
: the CSS style class of the elementstyle
: the CSS style of the elementoncommand
: the Javascript function to execute if the user change the valueonchange
: the Javascript function to execute if the user change the valueonmouseover
for mouse over eventsonmouseout
for mouse exit events<textbox value="This is a one line text" cols="20"/>The result is:
<textbox type="number" value="50" min="0" max="100" increment="1" cols="10"/>The result is:
progressmeter
element describes a progress bar.id
: the id of the elementhidden
: true if the element is hiddenvalue
: the current value for the progress bar (should be between 0 and max, default is 0)max
: the maximum value for the progress bar (default is 100)mode
: the mode of the progress bar. Can have one of the follwing values:top
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementwidth
: the element widthheight
: the element heightclass
: the CSS style class of the elementstyle
: the CSS style of the elementonmouseover
for mouse over eventsonmouseout
for mouse exit events<progressmeter width="100" value="50" />The result is:
listbox
element describes a list or table with one or more columns.listhead
element describes the header of a listbox
listheader
elementone columns definition in the header of a listbox
listitem
element describes one item in a listbox
listcell
element describes one cell in an item for a multicolumn listbox
id
: the id of the elementhidden
: true if the element is hiddendisabled
: true if the element is disabledselectedIndex
: the index of the currently selected rowtop
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementwidth
: the element widthheight
: the element heightclass
: the CSS style class of the elementstyle
: the CSS style of the elementonselect
: the Javascript function to execute if the user select a row<listbox"> <listitem label="Ruby"/> <listitem label="Emerald"/> <listitem label="Sapphire" selected="true"/> <listitem label="Diamond"/> </listbox>The result is:
tree
element describes a table with one or more columns. Contrary to the listbox
elemnt, the cells can be edited. Note that contrary to the original XUL specification, the tree element can not represent hierarchical trees.treecols
element describes the header of a tree
treecol
element describes ont column of the treetreechildren
element describes the content of the treetreeitem
and treerow
elements describes one rowtreecell
element describes one cellid
: the id of the elementhidden
: true if the element is hiddendisabled
: true if the element is disablededitable
: true if the element is editableselectedIndex
: the index of the currently selected roweditingColumn
: the editing columneditingRow
: the editing rowtop
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementwidth
: the element widthheight
: the element heightview
: return a view of the tree allowing to get or set the characteristics of cellsclass
: the CSS style class of the elementstyle
: the CSS style of the elementonselect
: the Javascript function to execute if the user select a rowonchange
: the Javascript function to execute if the user modifies a cell<tree> <treecols> <treecol label="First" /> <treecol label="Last" /> </treecols> <treechildren> <treeitem> <treerow> <treecell label="Sandra" /> <treecell label="Bullock" /> </treerow> </treeitem> </treechildren> </tree>Result:
scale
element describes a slider.id
: the id of the elementhidden
: true if the element is hiddendisabled
: true if the element is disabledvalue
: the current value fo the slidermax
: the maximum valuemin
: the minimum valuepageincrement
: the major increment valueincrement
: the minor increment valuetop
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementwidth
: the element widthheight
: the element heightclass
: the CSS style class of the elementstyle
: the CSS style of the elementoncommand
: the Javascript function to execute if the user change the valueonchange
: the Javascript function to execute if the user change the valueonmouseover
for mouse over eventsonmouseout
for mouse exit events<scale width="200" max="100" value="20" pageincrement="20" />The result is:
scrollbar
element describes a scrollbar.id
: the id of the elementhidden
: true if the element is hiddendisabled
: true if the element is disabledmaxpos
: the maximum position of the thumbcurpos
: the current position of the thumbpageincrement
: the major increment valueincrement
: the minor increment valuetop
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementwidth
: the element widthheight
: the element heightoncommand
: the Javascript function to execute if the user change the valueonchange
: the Javascript function to execute if the user change the valueonmouseover
for mouse over eventsonmouseout
for mouse exit events<stack> <scrollbar curpos="10" maxpos="200" width="200" top="50" left="50"/> </stack>The result is:
image
element describes an image.id
: the id of the elementhidden
: true if the element is hiddenimage
: the imagetop
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementwidth
: the element widthheight
: the element heightonmouseover
for mouse over eventsonmouseout
for mouse exit events<image src="hellfire.jpg" width="50" height="50" />
filefield
element describes a file selector. It is composed by a text field which shows the current path of the selected file, and button to open a file chooser.id
: the id of the elementhidden
: true if the element is hiddendisabled
: true if the element is disabledcols
: the number of columns of the selected pathtype
: the type of the selectable files, which can be:dialogtype
: the type of the file selector, which can be:title
: the title of the file chooser which will popup to select the fileextensions
: the file extensions which may filter the files to show and select. You can specify more than one extension by separating them with commas[3]
top
: the element position from its parent top corner. Only used if the parent is a stack
elementleft
: the element position from its parent left corner. Only used if the parent is a stack
elementclass
: the CSS style class of the elementstyle
: the CSS style of the elementoncommand
: the Javascript function to execute if the user select a fileonchange
: the Javascript function to execute if the user select a fileonmouseover
for mouse over eventsonmouseout
for mouse exit events<filefield extensions="xul" type="file" cols="20" />The result is:
tab
element specifies one tab under a tabbox element. tabs
element.<tabbox id="myTabList" selectedIndex="2"> <tabs> <tab label="A First tab"/> <tab label="Another tab"/> <tab label="Last tab"/> </tabs> <tabpanels> ... </tabpanels> </tabbox>
menuitem
element displays an item in a menulist
or a menu
.id
: the id of the elementlabel
: the label of the itemdisabled
: true if the element is disabledclass
: the CSS style class of the elementstyle
: the CSS style of the elementoncommand
: the Javascript function to execute if the user select the itemonchange
: the Javascript function to execute if the user select the itemonmouseover
for mouse over eventsonmouseout
for mouse exit eventsmenupopup
element<menu> <menupopup> <menuitem label="Red"/> <menuitem label="Blue"/> <menuitem label="Yellow"/> </menupopup> </menu>The result is:
menuseparator
element displays a separator in a menu
. This element has no attribute.menupopup
element.<menu> <menupopup> <menuitem label="Red"/> <menuitem label="Blue"/> <menuseparator/> <menuitem label="Yellow"/> </menupopup> </menu>The result is:
spacer
element is an invisible element setting a specified space between two controls.id
: the id of the elementwidth
: the width gapheight
: the height gap<vbox> <button label="button1" /> <spacer height="10px" /> <button label="button2" /> </vbox>The result is:
toolbarspacer
element is an invisible element setting a specified space between two controls in a toolbar.id
: the id of the elementwidth
: the width gap<toolbar id="nav-toolbar"> <toolbarbutton id="nav-users" label="Users"/> <toolbarbutton id="nav-groups" label="Groups"/> <toolbarspacer width="5px"/> <toolbarbutton id="nav-events" label="Events"/> </toolbar>
caption
element is used to set a label for the parent element.id
: the id of the elementlabel
: the label of the caption<groupbox> <caption label="Answer"/> <description value="Banana"/> <description value="Tangerine"/> <description value="Kiwi"/> </groupbox>
Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence