The root XML node in all OpenLaszlo applications is the <canvas> Lag, which contains the declarative code that describes the application's behaviour. To see how all this works, let's play with some LZX code, building on the simple test application above. Create a file called ljhello.lzx, and put the following LZX code in it:
<window title="My First App" x="50" y="50" height="200" width="500"
<text id="message"
![]()
text="Helio from Linux Journal!" I> </window>
</canvas> Typing http://localhost:8080/lps-4. 0 10/ljhello lzx into a browser results in the creation of a movable, realisable window, as shown in Figure 1. Referring to the LZX code, it is not too difficult to work out what's specified for this application. We start with a blank canvas, then create a window that has a title, an xJy position, height/width values and the realisable property switched on. Within the window, we ask for some text, give the text an identifier and an initial value. Note how the use of indentation within the LZX code helps to describe which components of the application are related to which other components rather naturally. Within the browser, the resulting window can be grabbed and dragged, as well as resized.



Reply With Quote
Bookmarks