[Laszlo-dev] Help swapping order of subviews

Henry Minsky henry.minsky at gmail.com
Sun Jul 8 09:15:47 PDT 2007


I found the solution, I had naively assumed that LzLayout was operating on
the parent's subviews, but LzLayout in fact has it's own
subviews array that it manages, and an API for manipulating it.



On 7/8/07, Henry Minsky <henry.minsky at gmail.com> wrote:
>
>
> I am trying to make a horizontal "dock" of icons, where the user can drag
> and drop them to re-order them.
>
> I have a view which has a horizontal simplelayout,  and I thought I could
> just swap two elements of the subviews
> array and call update() on the layout, and they would snap into a new
> order, but that doesn't seem to work.
>
> If I swap two views in the subviews array, then rerun the layout's
> update() method, the views report properly
> changed x coordinates, but they still display at their original locations.
> Is there some cache I don't know about
> which a view keep for it's children's postitions?
>
> Here's my scrolling view
>  <class name="scrollview" defaultplacement="content" clip="true"
> focusable="true">
>         <attribute name="scrollto" value="0" type="number"/>
>         <view x="${-parent.scrollto}" name="content" >
>           <simplelayout name="mylayout" axis="x"/>
>         </view>
>         <scrollbar name="sbx" axis="x" y="120"/>
>         <method name="updatelayout">
>           this.content.mylayout.update();
>         </method>
>
>  </class>
>
>
>
> --
> Henry Minsky
> Software Architect
> hminsky at laszlosystems.com
>
>


-- 
Henry Minsky
Software Architect
hminsky at laszlosystems.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.openlaszlo.org/pipermail/laszlo-dev/attachments/20070708/dbc618a7/attachment.html


More information about the Laszlo-dev mailing list