XUL Programmer's Reference Manual
|
|||||||||
<observes>
<observes> can be placed as a child of elements that want to observe particular attributes of other elements (Compare with the observes attribute on any element, which observes all the elements of the broadcaster). In the following example, two interface elements, a menuitem and a checkbox, are observing the disabled attribute of the sound broadcaster. This observation means that the user interface elements will themselves be disabled when the value of the broadcaster's disabled attribute changes from false to true, as it may when the event listener loadSounds() is executed. For more information about broadcasters and observes, see the Broadcasters and Observers XPToolkit documentation.
|
|||||||||
element | |||||||||
Description
The element attribute specifies the broadcasting element that is being observed.Syntax <observes element="id of broadcasting element" />Example Notes<broadcaster id="cut" ... /> ... <observes element="cut"/> When you use the <observes node and the element attribute, you must then specify which attributes of the broadcasting element are being observed. |
|||||||||
| |||||||||
attribute | |||||||||
Description
attribute names the particular attribute on the broadcaster that is being observed.Syntax Example<observes element="id of broadcaster" attribute="broadcasting attribute name" /> Notes<menuitem value="Sound Enabled"> <observes element="sound" attribute="disabled"/> </menuitem> ... <checkbox value="Sound On/Off" /> <observes element="sound" attribute="disabled" /> </checkbox> A value of "*" for attribute (i.e., attribute="*") picks up all of the attributes of the observing element with the exception of id.
|