23-Apr-05 (Created: 23-Apr-05) | More in 'laszlo'

laszlo: Example of declaring attributes

<class name="myclass">
  <attribute name="foo" value="1"/>
  <attribute name="thing" value="foo + 4" when="always"/>
  <attribute name="bar"/>

  <method event="oninit">
    this.bar= true; 
    this.foo = 4;            
  </method>

  <method name="dothis">
    if (bar) {
      this.setAttribute("foo", 6);
    }                
  </method>
</class>