Page 1 of 1

show / hide ?

Posted: Tue Apr 19, 2005 21:04
by kristian
Hello,
why doesnt show on a window affect the children which is set to shown ? Shouldnt this be the task of the window manager ?

- Kristian

Re: show / hide ?

Posted: Tue Apr 19, 2005 21:45
by spannerman
Hi kristian,

In my CEGUI apps, if I set a windows visibility to false, then all the contained windows / widgets are also hidden, and they are shown when the parent windows visibility is set to true.
So Im not sure I understand your problem, please be a bit more descriptive. Maybe post an example?

Re: show / hide ?

Posted: Fri Apr 22, 2005 14:16
by kristian
For example: I have a layout with 2 windows one is a menu and the other is a error window.

As per default the error window should of course not be shown so i set the visible property to false in the layout. Unfortunally when i want to show the error window i need to call show for each of the children like the text widget showing the error message. If i only call show for the error window the children is not shown automaticly.
The children has their visible prop. set to true in the layout.

Regards
Kristian

Re: show / hide ?

Posted: Sun Apr 24, 2005 00:08
by spannerman
Hmmm, ok try NOT setting the visibility of the children (to either true or false). By default, when you add a widget it is visible, but perhaps because you are force setting them as visible they may no longer get toggled according to the parent window.

So, just change the visibility of the parent window (e.g. your error window) and the children should appear/ disappear along with that.

If it still doesnt work, post a section of your code here where you are creating these windows and I'll take a look.

Re: show / hide ?

Posted: Sun Apr 24, 2005 04:10
by gcarlton
I'd guess what is happening is that when you specify the visibility in the layout, the child windows adopt their parent's default upon creation. So instead, leave everything visible in the layout, and then in code just toggle the root window to whatever you need.