In my example below, I create a view with a smaller nested view.  The  
inner view gets its size from constraints based on the its parent.   
The problem is, when the parent is resized too small, the constraints  
on the inner view become negative.  If you run my app, you can adjust  
the size with the slider and see what happens.  Basically, I need some  
way to have a constraint that tracks the parent, but cannot become  
negative.  Is there some way to do this in a contstraint?  Or possibly  
a different solution that doesn't have the negative constraint problem?


<canvas>

   <view x="20" y="20" layout="axis:y">
     <view layout="axis:x">
       <text text="outer view size: "/>
       <slider id="sizeslider" width="100" showvalue="true" value="50"/>
     </view>
     <view layout="axis:x">
       <text text="inner view size: "/>
       <text text="${box.subviews[0].height}" bgcolor="silver"/>
     </view>
   </view>

   <view id="box" x="20" y="80" bgcolor="blue"
         width="${sizeslider.value}" height="${sizeslider.value}">
     <view bgcolor="green" x="10" y="10"
           width="${parent.width - 20}" height="${parent.height - 20}"/>
   </view>


</canvas>


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

Reply via email to