window:addChildWIndow()

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

vr
Just popping in
Just popping in
Posts: 19
Joined: Thu Oct 12, 2006 20:57

window:addChildWIndow()

Postby vr » Thu Dec 07, 2006 15:57

Hi.

I have the following function that load a specified layout.
If there is no GuiSheet active it sets the loaded window as GuiSheet.

If there already is a GuiSheet() it adds the newly loaded layout as a child to the existing.

This gives the result that:

1. Both layouts are visible
2. only the layout loaded first is possible to interact with.

Below is the function to load the layouts:

bool loadLayout(const std::string& filename)
{
CEGUI::Window* newRoot = CEGUI::WindowManager::getSingleton().loadWindowLayout(filename);

if (newRoot) {
CEGUI::Window *oldRoot = CEGUI::System::getSingleton().getGUISheet();

if (oldRoot) {
oldRoot->addChildWindow(newRoot);
}
else
CEGUI::System::getSingleton().setGUISheet(newRoot);
return true;
}
return false;
}


Could anyone point me in the right direction?

Return to “Help”

Who is online

Users browsing this forum: No registered users and 10 guests