Order XUL widgets

By xngo on February 22, 2019

You can control where your XUL widgets will be inserted by using the position, insertbefore and insertafter attributes.

Here is an example:

<!-- This is the main box containing the statusbar -->
<vbox id="browser-bottombox">
  <label value="One"   position="1" />
  <label value="Two"   insertbefore="status-bar" />
  <label value="Three" insertafter="status-bar" />
</vbox>
 
<!-- The output will look like the following:
One
Two
the status bar here
Three
-->

About the author

Xuan Ngo is the founder of OpenWritings.net. He currently lives in Montreal, Canada. He loves to write about programming and open source subjects.