Destroy all windows?

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

songge3604
Quite a regular
Quite a regular
Posts: 60
Joined: Tue Oct 28, 2008 10:46

Destroy all windows?

Postby songge3604 » Wed Apr 15, 2009 10:04

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)

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Wed Apr 15, 2009 10:19

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.

songge3604
Quite a regular
Quite a regular
Posts: 60
Joined: Tue Oct 28, 2008 10:46

Postby songge3604 » Wed Apr 15, 2009 11:13

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.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 14 guests