Diff for /books/www/chapters/appc.html between versions 1.1 and 1.2

version 1.1, 2002/09/17 21:10:35 version 1.2, 2002/09/23 15:23:31
Line 1 Line 1
 <HTML>  <HTML>
 <HEAD><TITLE>Appendix C</TITLE></HEAD><BODY BGCOLOR=WHITE><H2>Appendix C</H2>  <HEAD><TITLE>Appendix C</TITLE></HEAD><BODY BGCOLOR=WHITE><H2>Appendix C</H2>
 <H1><A NAME="77003"></A> Programmer's Reference</H1>  <H1><A NAME="77003"></A> Programmer's Reference</H1>
<P>This appendix is an easy-to-use reference that contains information about XUL elements, XBL elements, and event attributes. Details about how each element and event works within a Mozilla application are covered in the rest of the book; to learn how to use XUL or XBL, read <A HREF="ch03.htm#32764">Chapter 3</A> and <A HREF="ch07.htm#70326">Chapter 7</A>.<P>This appendix is an easy-to-use reference that contains information about XUL elements, XBL elements, and event attributes. Details about how 
 each element and event works within a Mozilla application are covered in the rest of the book; to learn how to use XUL or XBL, read <A 
 HREF="ch03.html#32764">Chapter 3</A> and <A HREF="ch07.html#70326">Chapter 7</A>.
 <P>Once you know how to use XUL and XBL, this reference allows you to look up all available tags and elements quickly. Each entry listed below includes a brief description of the element or event, its purpose, what attributes the element or event has, and what other related elements or events you can look at to get more information.  <P>Once you know how to use XUL and XBL, this reference allows you to look up all available tags and elements quickly. Each entry listed below includes a brief description of the element or event, its purpose, what attributes the element or event has, and what other related elements or events you can look at to get more information.
 <H2><A NAME="77004"></A> XUL Element Set</H2>  <H2><A NAME="77004"></A> XUL Element Set</H2>
 <P>XUL isn't yet identified as a specification, and the  <!--INDEX STARTRANGE--XUL element set -->  <!--INDEX STARTRANGE--elements:XUL element set --> language is still changing. The elements and attributes given here represent a stable subset of the XUL widget set. XML allows you to define new elements and attributes arbitrarily (which is partly what makes a powerful extension like XBL possible) in your markup. Although it's discouraged in practice, Mozilla application developers-even those working on the Mozilla source itself-often use this flexibility to manage data in one-off attributes. For example, you may find XUL buttons in the source with attributes like "loading," which is not part of the XUL specification. In fact, XBL's presence, XML's flexibility, and DOM interfaces blur the distinction between valid XUL and other XML markup. This reference tries to document all widgets in the XUL 1.0 release, any additional attributes these elements have, and their use  <!--INDEX attributes:XUL:elements;XUL elements, attributes --> in Mozilla application development.  <P>XUL isn't yet identified as a specification, and the  <!--INDEX STARTRANGE--XUL element set -->  <!--INDEX STARTRANGE--elements:XUL element set --> language is still changing. The elements and attributes given here represent a stable subset of the XUL widget set. XML allows you to define new elements and attributes arbitrarily (which is partly what makes a powerful extension like XBL possible) in your markup. Although it's discouraged in practice, Mozilla application developers-even those working on the Mozilla source itself-often use this flexibility to manage data in one-off attributes. For example, you may find XUL buttons in the source with attributes like "loading," which is not part of the XUL specification. In fact, XBL's presence, XML's flexibility, and DOM interfaces blur the distinction between valid XUL and other XML markup. This reference tries to document all widgets in the XUL 1.0 release, any additional attributes these elements have, and their use  <!--INDEX attributes:XUL:elements;XUL elements, attributes --> in Mozilla application development.
Line 958  The <TT>wizardpage</TT> can contain  <!- Line 960  The <TT>wizardpage</TT> can contain  <!-
   
 <H2><A NAME="77457"></A> XBL Element Set</H2>  <H2><A NAME="77457"></A> XBL Element Set</H2>
 <P>The XBL 1.0 specification published on the <!--INDEX STARTRANGE--XBL element set;elements:XBL element set -->  mozilla.org web site appeared to be a beacon for application developers. Because the specification was available early in the development process, XBL seemed to be a tighter, more comprehensible language that was easier to learn and master than XUL. Since then, XBL development has strayed from the specification quite a bit, however, and now people consider XBL as opaque as XUL without good documentation that helps people learn and to create a roadmap for use based on continuing development.  <P>The XBL 1.0 specification published on the <!--INDEX STARTRANGE--XBL element set;elements:XBL element set -->  mozilla.org web site appeared to be a beacon for application developers. Because the specification was available early in the development process, XBL seemed to be a tighter, more comprehensible language that was easier to learn and master than XUL. Since then, XBL development has strayed from the specification quite a bit, however, and now people consider XBL as opaque as XUL without good documentation that helps people learn and to create a roadmap for use based on continuing development.
<P>This reference section tries to capture basic elements and attributes in XBL. Because it binds rather than creates content, XBL is smaller and inherently more formal than XUL. Nonetheless, as you will see, the language has quite a bit of range and complexity. Each entry in this section describes the XBL element and its purpose, its position in the hierarchy (i.e., which elements it contains and which elements it is contained by), and lists the element's attributes. <A HREF="ch07.htm#77027">Chapter 7</A> introduces XBL and shows how to use it. However, once you are familiar with the basics of XBL, you can consult this reference to find the XBL items you want.<P>This reference section tries to capture basic elements and attributes in XBL. Because it binds rather than creates content, XBL is smaller and 
 inherently more formal than XUL. Nonetheless, as you will see, the language has quite a bit of range and complexity. Each entry in this section describes the XBL element and its purpose, its position in the hierarchy (i.e., which elements it contains and which elements it is contained by), and lists the element's attributes. <A HREF="ch07.html#77027">Chapter 7</A> introduces XBL and shows how to use it. However, once you are familiar with the basics of XBL, you can consult this reference to find the XBL items you want.
 <HR><H3><A NAME="77463"></A> binding</H3>  <HR><H3><A NAME="77463"></A> binding</H3>
 <P>A single XBL binding  <P>A single XBL binding
 <A NAME="77463"></A> Contains  <A NAME="77463"></A> Contains
Line 1180  This element defines a stylesheet  <!--I Line 1183  This element defines a stylesheet  <!--I
 <PRE>&lt;menulist id="eventList" editable="true" flex="1" onchange="addEvent(this)"&gt;</PRE>  <PRE>&lt;menulist id="eventList" editable="true" flex="1" onchange="addEvent(this)"&gt;</PRE>
 <P>The syntax is different in XBL. Here the event is specified as the value of the <TT>name</TT> attribute, which is attached to the <TT>handler</TT> element. One or more of these elements can optionally be contained in a binding. The given value is the event's name, minus the "on" prefix. The executed code is contained in the body of the handler inline, or in the <TT>action</TT> attribute, as shown in this example:  <P>The syntax is different in XBL. Here the event is specified as the value of the <TT>name</TT> attribute, which is attached to the <TT>handler</TT> element. One or more of these elements can optionally be contained in a binding. The given value is the event's name, minus the "on" prefix. The executed code is contained in the body of the handler inline, or in the <TT>action</TT> attribute, as shown in this example:
 <PRE>&lt;handler name="focus" action="this.activate( )"/&gt;</PRE>  <PRE>&lt;handler name="focus" action="this.activate( )"/&gt;</PRE>
<P><A HREF="ch07.htm#77027">Chapter 7</A> provides a closer look at events in XBL. All the events listed here are available for use in XUL and XBL.<P><A HREF="ch07.html#77027">Chapter 7</A> provides a closer look at events in XBL. All the events listed here are available for use in XUL and 
 XBL.
 <HR><H3><A NAME="77563"></A> onblur</H3>  <HR><H3><A NAME="77563"></A> onblur</H3>
 Usually used for input element  <!--INDEX onblur event;events onblur --> such as a textbox, this event triggers actions when the focus leaves a widget. This action is the opposite of the <TT>onfocus</TT> event.  Usually used for input element  <!--INDEX onblur event;events onblur --> such as a textbox, this event triggers actions when the focus leaves a widget. This action is the opposite of the <TT>onfocus</TT> event.
 <HR><H3><A NAME="77564"></A> onbroadcast</H3>  <HR><H3><A NAME="77564"></A> onbroadcast</H3>
This event is activated when the  <!--INDEX onbroadcast event;events:onbroadcast --> broadcaster attributes being "listened to" are changed. It can be placed on the <TT>observes</TT> element, which is placed in an element that is being listened to, or on an element that uses the <TT>observes</TT> attribute. Refer to <A HREF="ch03.htm#77084">Chapter 3</A> for more information on broadcasters and observers.This event is activated when the  <!--INDEX onbroadcast event;events:onbroadcast --> broadcaster attributes being "listened to" are changed. It 
 can be placed on the <TT>observes</TT> element, which is placed in an element that is being listened to, or on an element that uses the <TT>observes</TT> attribute. Refer to <A HREF="ch03.html#77084">Chapter 3</A> for more information on broadcasters and observers.
 <HR><H3><A NAME="77565"></A> onchange</H3>  <HR><H3><A NAME="77565"></A> onchange</H3>
 This event is fired when the value  <!--INDEX onchange event;events:onchange --> of a particular widget's (element) attribute that uses it changes. A menulist selection is one example. It can also be used on an observer when the attribute the observer listens to changes.  This event is fired when the value  <!--INDEX onchange event;events:onchange --> of a particular widget's (element) attribute that uses it changes. A menulist selection is one example. It can also be used on an observer when the attribute the observer listens to changes.
 <HR><H3><A NAME="77566"></A> onclick</H3>  <HR><H3><A NAME="77566"></A> onclick</H3>

Removed from v.1.1  
changed lines
  Added in v.1.2


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>