states.lzx

<canvas>
  <window title="Single-state window" bgcolor="yellow">
    <simplelayout axis="y"/>
    <text multiline="true" width="100%">A window with static contents.</text>
    <button onclick="msw.setAttribute('visible', true)">Next</button>
  </window>
  
  <window title="Multi-state window" y="100" id="msw" visible="false">
    <!-- initial state -->
    <state name="s1" applied="true">
      <!-- same as the content of the single-state window above -->
      <attribute name="bgcolor" value="yellow"/>
      <simplelayout axis="y"/>
      <text multiline="true" width="100%">A window with two states.
      The content of each <state> looks like the content of a
      static window.</text>
      <button onclick="parent.setstate(parent.s2)">Forward</button>
    </state>
    
    <state name="s2">
      <attribute name="bgcolor" value="white"/>
      <simplelayout axis="x"/>
      <button onclick="parent.setstate(parent.s1)">Back</button>
      <text>A second state with a horizontal layout and a different
      background color.</text>
    </state>
    
    <method name="setstate" args="s">
      s1.setAttribute('applied', false); s2.setAttribute('applied', false); s.setAttribute('applied', true);
    </method>
  </window>
</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.              *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->
<!-- @LZX_VERSION@                                                         -->

Cross References

Named Instances