Page 1 of 1

Destroy all windows?

Posted: Wed Apr 15, 2009 10:04
by songge3604
I want to destroy all window when game exit.

But I find a problem, it is that default window is GUISheet? It doesn't has window's functions, so I can't use for loop to destroy all windows.

I want to destroy all windows like this:

for idx in xrange(win.ChildCount):
win.getChildByIdx(idx)

Posted: Wed Apr 15, 2009 10:19
by CrazyEddie
Hi,

You know that CEGUI will destroy all windows at exit anyway? And also that unless you specify a window not to be destroyed by it's parent, by destroying the parent window you will also destroy all attached child windows automatically?

Aside from this all window types are derived from Window and so all window types have those member functions, so it should be working.

CE.

Posted: Wed Apr 15, 2009 11:13
by songge3604
Yes, you are right.

I just tired, I think.

for i in xrange(_minigame_root.ChildCount):
window = _minigame_root.getChildAtIdx(i)
_win_mgr.destroyWindow(window)

above, destroy all windows.