toni
06-19-2007, 01:10 AM
I'm still trying to understand the mechanisms behind strechtes. I could not get this to work in 4.0.2 the way I thought it should work. So I installed 3.3.3 and then things started to fall in place.
Use the following code to show the differences in behaviour. In 3.3.3 the red square is initially strechted to the size of the yellow square and the green square is proportionally strechted within the red square.
In 4.0.2 initially nothing happens. Click the grow-button and the red square goes 100% width, taking the green square along with it. Shrinking doesn't work at all.
So: did the language change from 3.3.3 to 4.0.2 or is this a bug?
<canvas>
<simplelayout axis='y'/>
<view id='v' width='100' height='100' bgcolor='yellow' stretches='both' opacity='.5'>
<view id='v2' width='50' height='20' bgcolor='red' opacity='.5'/>
<view id='v3' width='10' height='10' bgcolor='green' opacity='.5'/>
</view>
<button onclick='v.setAttribute("width",200)'>grow</button>
<button onclick='v.setAttribute("width",100)'>shrink</button>
</canvas>
Use the following code to show the differences in behaviour. In 3.3.3 the red square is initially strechted to the size of the yellow square and the green square is proportionally strechted within the red square.
In 4.0.2 initially nothing happens. Click the grow-button and the red square goes 100% width, taking the green square along with it. Shrinking doesn't work at all.
So: did the language change from 3.3.3 to 4.0.2 or is this a bug?
<canvas>
<simplelayout axis='y'/>
<view id='v' width='100' height='100' bgcolor='yellow' stretches='both' opacity='.5'>
<view id='v2' width='50' height='20' bgcolor='red' opacity='.5'/>
<view id='v3' width='10' height='10' bgcolor='green' opacity='.5'/>
</view>
<button onclick='v.setAttribute("width",200)'>grow</button>
<button onclick='v.setAttribute("width",100)'>shrink</button>
</canvas>