Hi John,

If you put the oninit handler in the parent view you'll see the values of 
(x,y) after the layout has run. Alternatively, if you change the handler 
from 'oninit' to 'ony' you'll see it run twice.

Phil

>Well, I am now officially confused about the behavior of simplelayout
>(and not for the first time).
>
>This is what I have written in the reference page now:
>
><p><classname>simplelayout</classname> extends 
><classname>LzLayout</classname>, and therefore it is responsible for 
>arranging all of the subviews for the view that it is attached to.
><classname>simplelayout</classname>
>affects either the <attribute>x</attribute> or <attribute>y</attribute> 
>value, depending on the value of the <attribute>axis</attribute>
>attribute. <classname>simplelayout</classname> places the first subview at 
>(0, 0) and then places each subsequent subview based on the width (or 
>height) of the previous subview, depending on which axis was specified.</p>
>
>However, consider the following:
>
><canvas  debug="true">
>    <view >
>      <simplelayout axis="y" spacing="10"/>
>      <view bgcolor="blue" y="40" height="30" width="50">
>          <handler name="oninit">
>             Debug.write("x is " + x, "y is " + y)
>          </handler>
>      </view>
>      <view bgcolor="blue" height="30" width="50"/>
>      <view bgcolor="blue" height="30" width="50"/>
>    </view>
></canvas>
>
>No matter what values you assign to x and y of the first view, it
>always appears in the upper left corner.  That is, to the eye it
>appears that it's at x=0, y=0.
>
>However, the debug statements reflect the values given to x and y in
>the opening tag.
>
>So the question comes down to, who am I going to believe, the debug
>statement or my lying eyes?
>
>Or, more likely, am I overlooking something really obvious?
>
>Thanks
>
>jrs
>
>_______________________________________________
>Laszlo-dev mailing list
>[email protected] 
>http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

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

Reply via email to