XUL Programmer's Reference Manual

<progressmeter>

Attributes Common Children
id <observes />
value  
mode  
align  
onclick  

 
The progressmeter is a widget that displays the progress of an operation as it executes. In Mozilla the progress meter (with the statusbar to the right) looks like this:
 

 
When larger pages load in a browser, for instance, the progress meter shows the percentage of the page that has been loaded and how much remains to be done. The following example shows a progressmeter defined within a XUL box:
 
<box id="state-box" align="horizontal" flex="100%" style="min-width: 1px">
  <box align="vertical" style="width:100px">
    <spring flex="100%"/>
    <progressmeter id="statusbar-icon" mode="normal"
        align="horizontal" value="0" onclick="dumpProgress()">
        <observes element="Browser:LoadingProgress" attribute="mode"/>
        <observes element="Browser:Throbber" attribute="busy" 
          onbroadcast="onProgress()"/>
     </progressmeter>
     <spring flex="100%"/>
  </box>
</box>

 
 
 
value
Description
value is a required attribute for specifying the value or name of the progressmeter. 
Syntax
<progressmeter value="character or string" />


Example

<progressmeter id="nav=prog value="0" />


Notes

The value is not visible for progressmeters, as it is for titledbuttons and other XUL widgets. The value in this case XXX.

 
 
 
mode
Description
mode is a required attribute for specifying whether the length of the operation is known or unknown. 
Syntax
<progressmeter mode="determined | undetermined | normal" />


Example

<progressmeter id="nav-prog mode="undetermined" />


Notes

When the length of the operation cannot be determined, as for example when page loading times are affected by network traffic and other unforeseeables, you should set this attribute to "undetermined."
 

 
onclick
Description
onclick is an optional event listener attribute for the progressmeter. 
Syntax
<progressmeter id="string" onclick="event handler code" />


Example

<progressmeter id="string" onclick="dumpLoad()" />


Notes

The click event is fired when the user clicks on the actual progress meter. If you want to have an action performed -- if you want to cancel the operation that the progressmeter is tracking, for instance -- then you can write an event handler for this attribute, as in the following example:
 

 


Last updated: 13:10 1/26/00 Ian Oeschger