[Laszlo-dev] Help swapping order of subviews
P T Withington
ptw at openlaszlo.org
Mon Jul 9 05:41:55 PDT 2007
That seems counter-intuitive. Why does it need its own array?
On 2007-07-08, at 12:15 EDT, Henry Minsky wrote:
> 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
More information about the Laszlo-dev
mailing list