I've used the following code to create a Popup Menu when 'F1' Key is pressed.
Code: Select all
bool KeyPressed(const dtCore::Keyboard* keyboard, int key)
{
switch( key )
{
case osgGA::GUIEventAdapter::KEY_F1:
{
try
{
menu1 = static_cast<CEGUI::PopupMenu*>(wm->createWindow ("WindowsLook/PopupMenu", "help"));
mWindowBackground->addChildWindow(menu1);
menu1->setFadeInTime(0.1f);
menu1->setFadeOutTime(3.0f);
}
catch(CEGUI::Exception &e)
{
Log::GetInstance().LogMessage(Log::LOG_WARNING, __FUNCTION__,
"CEGUI::%s", e.getMessage().c_str() );
}
}
}
}
But if I press 'F1' Key, the following error message is displayed in the console Window and Popup Menu is not displayed:
Warn: 14:58:10:<TestGUIApp::KeyPressed>CEGUI::WindowManager::createWindow - A Winodow object with the name already exists with in the system.
What to do?

