Thanks, that works better.  There is still a problem when I wave the mouse over the views quickly - some of them don't shrink. So there ends up being multiple views enlarged. Maybe some mouseout events aren't being generated?  Any ideas on that one?
The use of state here is unnecessary, and is causing you problems. Animators are designed to work together, so if you change your example as follows I think you'll find that things work more like you expect.

You also mention that this happens in the examples in the reference as well. Can you let me know which ones so we can make sure they are correct?
The 'state' example in the reference.  If you click the button on the window in the first example on that page quickly it does some really strange resizing (it shrinks to nothing most of the time when I try it).
<canvas bgcolor="black">

   <dataset name="photos">
       <photos>
           <photo color="white"/>
           <photo color="red"/>
           <photo color="black"/>
           <photo color="blue"/>
           <photo color="yellow"/>
           <photo color="green"/>
           <photo color="gray"/>
       </photos>
   </dataset>

   <class name="icon" extends="view" width="75" height="75">
       <attribute name="value" type="string" value="red"/>
       <animatorgroup name="max" process="simultaneous" duration="500" start="false">
           <animator name="w" attribute="width" to="150"/>
           <animator name="h" attribute="height" to="150"/>
       </animatorgroup>
       <animatorgroup name="min" process="simultaneous" duration="500" start="false">
           <animator name="w" attribute="width" to="75"/>
           <animator name="h" attribute="height" to="75"/>
       </animatorgroup>
       <method event="onmouseover">
           max.doStart();
       </method>
       <method event="onmouseout">
           min.doStart();
       </method>
       <view width="${parent.width}" height="${parent.height}" bgcolor="white"/>
       <view x="1" y="1" width="${parent.width - 2}" height="${parent.height - 2}" bgcolor="red"/>
   </class>

   <view name="icons">
       <simplelayout axis="x" spacing="8"/>
       <view name="list" datapath="photos:/photos/photo">
           <icon/>
       </view>
   </view>

</canvas>

On Dec 15, 2005, at 10:55 PM, Denis Bohm wrote:

I'm trying to make a layout with a number of small views where the view under the mouse is expanded.  The change in state from normal to expanded is animated.  If I slowly move the mouse in and out of a view then it works fine.  If I move in and move out before the animation is done then the view ends up in an incorrect state (funky size).  This happens in the examples in the reference also.  Is this a known bug?

<canvas bgcolor="black">

   <dataset name="photos">
       <photos>
           <photo color="white"/>
           <photo color="red"/>
           <photo color="black"/>
           <photo color="blue"/>
           <photo color="yellow"/>
           <photo color="green"/>
           <photo color="gray"/>
       </photos>
   </dataset>

   <class name="icon" extends="view" width="75" height="75">
       <attribute name="value" type="string" value="red"/>
       <state name="max">
           <animatorgroup name="size" process="simultaneous" duration="500">
               <animator name="w" attribute="width" to="150"/>
               <animator name="h" attribute="height" to="150"/>
           </animatorgroup>
       </state>
       <state name="min" apply="true">
           <animatorgroup name="size" process="simultaneous" duration="500">
               <animator name="w" attribute="width" to="75"/>
               <animator name="h" attribute="height" to="75"/>
           </animatorgroup>
       </state>
       <method event="onmouseover">
           min.remove();
           max.apply();
       </method>
       <method event="onmouseout">
           max.remove();
           min.apply();
       </method>
       <view width="${parent.width}" height="${parent.height}" bgcolor="white"/>
       <view x="1" y="1" width="${parent.width - 2}" height="${parent.height - 2}" bgcolor="red"/>
   </class>

   <view name="icons">
       <simplelayout axis="x" spacing="8"/>
       <view name="list" datapath="photos:/photos/photo">
           <icon/>
       </view>
   </view>

</canvas>
_______________________________________________
Laszlo-user mailing list


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

Reply via email to