Destroying Windows - Remove from parent First?

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

User avatar
Van
Just can't stay away
Just can't stay away
Posts: 225
Joined: Fri Jan 21, 2005 20:29
Contact:

Destroying Windows - Remove from parent First?

Postby Van » Sun Apr 30, 2006 17:30

Before destroying a window, is it required to remove it from the parent first?

In other words, is this OK?

Code: Select all


   mRootWindow = mWinMgr.loadWindowLayout( (CEGUI::utf8*)"Intro.xml");
   CEGUI::System::getSingleton().getGUISheet()->addChildWindow( mRootWindow );

... later in life ...

   if ( mRootWindow )
      CEGUI::WindowManager::getSingleton().destroyWindow( mRootWindow );




or should it really be done as so:

Code: Select all

... later in life ...

   if ( mRootWindow )
   {
      CEGUI::System::getSingleton().getGUISheet()->removeChildWindow( mRootWindow );

      CEGUI::WindowManager::getSingleton().destroyWindow( mRootWindow );
   }


User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Sun Apr 30, 2006 17:36

calling destroyWindow is just fine :)

User avatar
vinny_the_true
Just popping in
Just popping in
Posts: 7
Joined: Wed Aug 10, 2005 10:11

Postby vinny_the_true » Wed May 03, 2006 09:02

just be aware that when you destroy a window, you destroy all of its children too.


Return to “Help”

Who is online

Users browsing this forum: Baidu [Spider] and 16 guests