A Window object ... does not exist within the system

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

TMichael66
Just popping in
Just popping in
Posts: 1
Joined: Wed Jan 10, 2007 14:20

A Window object ... does not exist within the system

Postby TMichael66 » Thu Jan 11, 2007 00:49

My code (straight from the Ogre's Basic Tutorial 6 about CEGUI) compiles cleanly, but the application crashes after loading the window at runtime. I am using VC++ 8.0 and Windows XP Home.

Here is the XML file:

Code: Select all

<?xml version="1.0" ?>
<GUILayout>
    <Window Type="DefaultWindow" Name="Tutorial Gui">
        <Window Type="TaharezLook/Button" Name="Quit">
             <Property Name="AbsoluteRect" Value="l:224.000000 t:216.000000 r:416.000000 b:264.000000" />
             <Property Name="RelativeRect" Value="l:0.350000 t:0.450000 r:0.650000 b:0.550000" />
             <Property Name="Text" Value="Quit" />
             </Window>
        </Window>
</GUILayout>


Here is the section of code in createscene where I load the layout:

Code: Select all

mEditorGuiSheet = CEGUI::WindowManager::getSingleton().loadWindowLayout((CEGUI::utf8*)"Tutorial Gui.xml");
      mGUISystem->setGUISheet(mEditorGuiSheet);
      CEGUI::PushButton* quitButton = (CEGUI::PushButton*)CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)"Quit");


And here are the last few lines of the CEGUI log:


09/01/2007 17:39:53 (InfL2) ---- Resource loading for GUI scheme 'TaharezLookSkin' completed ----
09/01/2007 17:39:53 (InfL2) ---- Beginning loading of GUI layout from 'Tutorial Gui.xml' ----
09/01/2007 17:39:53 (InfL1) ---- Successfully completed loading of GUI layout from 'Tutorial Gui.xml' ----
09/01/2007 17:39:53 (Error) Exception: WindowManager::getWindow - A Window object with the name 'Quit' does not exist within the system


The xml seems to be loading, but the window name it defines is not being recognized. I copied every CEGUI file included with Ogre into my working directory just to make sure that wasn't the issue. Any idea what I am missing here?

User avatar
scriptkid
Home away from home
Home away from home
Posts: 1178
Joined: Wed Jan 12, 2005 12:06
Location: The Hague, The Netherlands
Contact:

Postby scriptkid » Thu Jan 11, 2007 08:35

Hi and welcome :-)

Okay so without the crashing line you see a button on screen, right? Your code looks fine, so you might add some tracing by adding something like this (prints all window names):

Code: Select all

WindowManager::WindowIterator it =  CEGUI::WindowManager::getSingleton().getIterator();
for(; !it.isAtEnd() ; ++it) {
  const char* windowName = it.getCurrentValue()->getName().c_str();
  printf("Name: %s\n", windowName);
}


to see if it is in the list...

If you don't have a console, just put a breakpoint at the 'printf' to see what's in 'windowName'.

Good luck!


Return to “Help”

Who is online

Users browsing this forum: No registered users and 11 guests