first, sorry for my bad english
I have a strange problem with the function CEGUI::WindowManager::getWindow(const String &name) const.
Here is my code:
Code: Select all
CEGUI::WindowManager* WindowMgr = mGUIManager.getWindowManager();
mGUIManager.setRootWindow(WindowMgr->loadWindowLayout("nubitor.layout", "Root")); // = setGuiSheet()
CEGUI::PushButton* quitButton = (CEGUI::PushButton*)WindowMgr->getWindow("[b]Root/Menu/Quit[/b]"); // Here is the problem.
quitButton->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&VDrawer2D::onButton_Quit, this));
CEGUI return me these exeptions:
CEGUI Exception: WindowManager::getWindow - A Window object with the name 'Root/Menu/Quit' does not exist within the system
terminate called after throwing an instance of 'CEGUI::UnknownObjectException'
Of course i have this in my XML layout:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<GUILayout >
<Window Type="DefaultWindow" Name="Root" >
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
<Window Type="WindowsLook/FrameWindow" Name="Root/Menu" >
<Property Name="Text" Value="Menu" />
<Property Name="TitlebarFont" Value="Commonwealth-10" />
<Property Name="SizingEnabled" Value="False" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="TitlebarEnabled" Value="True" />
<Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{0.21875,0},{1,0}}" />
<Property Name="DragMovingEnabled" Value="False" />
<Property Name="CloseButtonEnabled" Value="False" />
<Window Type="WindowsLook/Button" Name="Root/Menu/Quit" >
<Property Name="Text" Value="Quit" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.9,0},{0.9,0},{0.95,0}}" />
</Window>
<Window Type="WindowsLook/Button" Name="[b]Root/Menu/Save[/b]" >
<Property Name="Text" Value="Save" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.85,0},{0.9,0},{0.9,0}}" />
</Window>
<Window Type="WindowsLook/Button" Name="Root/Menu/Open" >
<Property Name="Text" Value="Open" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.8,0},{0.9,0},{0.85,0}}" />
</Window>
</Window>
</Window>
</GUILayout>
I would be verry happy if you could help me :p
Thank.