In the "Laszlo in 10 minutes"/Object-Oriented/Attribute section (
http://bit.ly/gomk4w ) the child class refers to the attribute .bordersize
in its *parent* even though the attribute is only defined for the child...
how can this work?

Source code follows:
<canvas>
  <simplelayout spacing="5"/>

  <class name="box" height="100" width="100" bgcolor="red"/>

  <class name="borderedbox" extends="box">
    <attribute name="bordersize" value="3"/>
    <view bgcolor="yellow"
          x="${parent.bordersize}"
          y="${parent.bordersize}"
          width="${parent.width - parent.bordersize*2}"
          height="${parent.height - parent.bordersize*2}"/>
  </class>

  <borderedbox/>
  <borderedbox bordersize="6"/>
  <borderedbox bordersize="9"/>
</canvas>

Reply via email to