Including Libraries

OpenLaszlo allows a program to be divided into smaller files for the sake of modularity. It achieves this by introducing the include tag. The resource that is to be included in another file must have the library tag as its topmost tag. For example, the code in Listing 1.5 includes the code in Listing 1.6.

Listing 1.5. Using the include tag
<canvas height="100">
    <include href="include.lzx"/>
</canvas>

Listing 1.6. The included resource
<library>
    <radiogroup>
        <radiobutton text="New York"/>
        <radiobutton text="Chicago"/>
        <radiobutton text="Seattle"/>
    </radiogroup>
</library>

It is effectively the same as the following code:

<canvas height="100">
    <radiogroup>
        <radiobutton text="New York"/>
        <radiobutton text="Chicago"/>
        <radiobutton text="Seattle"/>
    </radiogroup>
</canvas>

Note that changes to an include file will be reflected the next time the LZX application is invoked.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset