Same window name

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

shimrod
Just popping in
Just popping in
Posts: 7
Joined: Thu Jun 23, 2011 14:41

Same window name

Postby shimrod » Thu Jun 23, 2011 14:46

Hi,

I am new to Cegui, and I encounter some problems.
In my game, I use a layout to show a properties screen for an item clicked. This little window has a root window called PropMenu.
When this windows is closed, I destroy it through windowmanager->destroyWindow().

When player clicks on another item, it reloads the window, and then I got an error because the name "PropMenu" is already use:

Code: Select all

GUILayout_xmlHandler::startElement - layout loading has been aborted since Window named 'Root' already exists.


Even I can find a workaround (show/hide the window), the question is still here, if I wish to have multiple properties window from the same layout to be open at the same time.

Can you guide me?

Thank you

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Same window name

Postby Kulik » Thu Jun 23, 2011 15:30

In 0.7, each window has to have a unique (system-wide) name. You can load multiple layouts by using the prefix functionality (see WindowManager::loadWindowLayout). You can also only load the layout once and then clone it as many times as needed (see Window::clone).

In 0.8, windows can have the same names as long as they are not added to the same parent. This was a change I proposed and even though it might infuriate a lot of people, I think it's a good change that will ease all of these situations.

shimrod
Just popping in
Just popping in
Posts: 7
Joined: Thu Jun 23, 2011 14:41

Re: Same window name

Postby shimrod » Fri Jun 24, 2011 15:24

Clone function is a pretty good idea... Thank you.

In fact my problem, didn't come from CEgui, sorry for trouble...


Return to “Help”

Who is online

Users browsing this forum: No registered users and 15 guests