Home
Categories
Dictionnary
Download
Project Details
Changes Log
FAQ
License

XUL widget


The XULWidget is the class which represents any XUL control

id attribute

Widgets can have an id attribute which allow them to be searchable in their parent XULDocument.

For example:

      <window id="Test" title="Test XULScripts" orient="horizontal" onload="loaded()"
      xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
      <script>
         function clicked() {
            document.getElementById("theButton").label = "No";
         }
      </script>      
      <button id="theButton" label="Yes" oncommand="clicked()" />
      </window>                   

Getting a widget in the tree

Main Article: XULDocument

You can get any widget in the tree (providing it has an id attribute) with the following method: On Javascript scripts, you can also use the document property, such as:

      var widget = document.getElementById("open");

You can get the current widget which is the source of the last user event by one of the following methods: You can get the current window which is the root of the widget which is at the origin of the last user event by: For example in Javascript:

      var widget = document.getcurrentWindow();

See also


Categories: api

Copyright 2008-2020 Herve Girod. All Rights Reserved. Documentation and source under the LGPL licence