[Laszlo-user] change parent of a subview
Paulo Scardine
paulo at scardine.com.br
Wed Jun 13 06:09:50 PDT 2007
Can Barışcan escreveu:
> How can I change the parent of a view within a view that has a layout? I
> have something that is inited in a view and placed according to a layout.
> Instead of destroying it, I want to hide it and put it in an invisible
> view
> (restoring the layout for the remaining elements). Then when I want
> to show
> it again, I want to put it back inside the layout but like it was
> added from
> scratch like a new thing was added to the layout, so this way I don't
> have
> to destroy, then initialize it again each time I virtually close and open
> it. Opening puts things according to layout.. Like
> windows.subviews[1].setParent(windowstack)
> then windowstack.subviews[1].setParent(windows).
>
From what I understood of your problem (not much, I have to confess) I
would write a custom layout that hides or show your something based on
an attribute. Then you can write something like:
<something name="somename" hideme="true" />
So you can hide or show it on your custom layout with
"somename.setAttribute('hideme', false)", or use a constraint on
"hideme" attribute.
Custom layouts are funny, try it!
Regards,
--
Paulo
More information about the Laszlo-user
mailing list