Um, no. Width is the difference between two positions, so
independent of coordinate system. x is a position, so depends on the
coordinate system. You are taking an x position from one coordinate
system and applying it in another. The view system is just doing
what you asked it to. Take Dan's advice.
On 9 Feb 2006, at 14:17, William Krick wrote:
But shouldn't it still work with parent.x+5 anyway?
I mean, parent.width-10 works as expected.
-----Original Message-----
From: Dan Stowell [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 09, 2006 2:04 PM
To: William Krick; [email protected]
Subject: RE: [Laszlo-user] syntax problem using variables in a
view's x
and y
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
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user