[Laszlo-user] change parent of a subview
Vincent de Phily
vdephily at bluemetrix.com
Wed Jun 13 06:51:47 PDT 2007
On Wednesday 13 June 2007 14:07:45 Can Barışcan wrote:
> So how do I change the position of a subview then? Put it above other
> views etc.
>
> On 6/13/07, Can Barışcan <canbarcan at gmail.com> wrote:
> > In the forum I've seen someone say : you can't change parent dynamically.
> > Oh well. I'll try to hack it in some other way.
See
* View : bringToFront() sendToBack()
* Layout : setLayoutOrder() swapSubviewOrder()
* Datapath : setOrder()
Not knowing your exact problem, there might be many solutions.
I initially wrote a reorder/move/copy/delete items using layout functions and
recreating items when absolutely necessary, but then I changed to doing the
same using datapath functions. It is much buggyer/harder to use, and tends to
reinstanciate (instead of moving) nodes too easily, but then my dataset
allways reflects the UI, and I can save it on the server.
Also, consider using the canvas (or other high-enough parents) as the parent
of your object, if you want to move them around freely. Menus do that : only
one instance, child of the canvas, that gets unhidden and repositioned when
you open a menu.
--
Vincent de Phily
More information about the Laszlo-user
mailing list