layout-and-design-$17.lzx
<canvas height="100" width="100%">
<class name="col" clickable="true" bgcolor="blue" width="15" height="80"/>
<layout>
<attribute name="spacing" value="25
" type="number"/>
<method name="addSubview" args="s">
super.addSubview(s);
this.update();
</method>
<method name="update" args="e=null">
if (this.locked) return;
this.locked = true;
for (var i = 0; i < subviews.length; i++){
subviews[i].setAttribute('x', i * this.spacing);
}
this.locked= false;
</method>
</layout>
<col/>
<col/>
<col/>
<col/>
</canvas>