antun
05-08-2003, 04:04 PM
Laszlo resolves circular constraints very well. In the following example the red view's y attribute is constrained to the blue view's y attribute, and vice versa:
<canvas>
<view name="redview" bgcolor="red"
onmousedown="ds.apply()" onmouseup="ds.remove()"
width="40" height="40" y="blueview.y">
<dragstate name="ds"/>
</view>
<view name="blueview" bgcolor="blue"
onmousedown="ds.apply()" onmouseup="ds.remove()"
width="40" height="40" y="redview.y">
<dragstate name="ds"/>
</view>
<simplelayout spacing="40" axis="x"/>
</canvas>
Enjoy!
<canvas>
<view name="redview" bgcolor="red"
onmousedown="ds.apply()" onmouseup="ds.remove()"
width="40" height="40" y="blueview.y">
<dragstate name="ds"/>
</view>
<view name="blueview" bgcolor="blue"
onmousedown="ds.apply()" onmouseup="ds.remove()"
width="40" height="40" y="redview.y">
<dragstate name="ds"/>
</view>
<simplelayout spacing="40" axis="x"/>
</canvas>
Enjoy!