Home
Categories
Dictionary
Glossary
Download
Project Details
Changes Log
What Links Here
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 the current widget which is the source of the last user event by one of the following methods:
  • On the current document: document.getCurrentWidget()
  • On the XUL ScriptHelper: getCurrentWidget()
You can get the current window which is the root of the widget which is at the origin of the last user event by:
  • On the current document: document.getCurrentWindow()
  • On the XUL ScriptHelper: getCurrentWindow()
On XUL Javascript scripts, you can also use the document property, such as:
      var widget = document.getElementById("open");
For example in Javascript:
      var widget = document.getcurrentWindow();

See also


Categories: builtin-applis

Copyright 2017-2020 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence