The second black box isn't positioned correctly relative to its parent.

That's because it is constrained to its parent's x position. Nested views have coordinates relative to their parent. So, if you set the x of the black view to 5, then it will always be 5 pixels from its parent's left border.


Do I have the syntax wrong?



<canvas width="600" height="400">
  <simplelayout axis="x"/>

  <view bgcolor="red" width="100" height="100">
    <view bgcolor="black"
          width="${parent.width-10}"
          height="${parent.height-10}"
          x="${parent.x+5}"
          y="${parent.y+5}"/>
  </view>

  <view bgcolor="red" width="100" height="100">
    <view bgcolor="black"
          width="${parent.width-10}"
          height="${parent.height-10}"
          x="${parent.x+5}"
          y="${parent.y+5}"/>
  </view>

</canvas>
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user


Dan Stowell
Software Engineer
Laszlo Studios

_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to