Page 1 of 1

Existing code not working with Falagard

Posted: Wed Sep 21, 2005 14:41
by SupSuper
This is part of a code to dynamically create widgets during runtime, without using layouts:

Code: Select all

    CEGUI::String buttonName = "XNet/Buttons/";
    buttonName += name.c_str();

    CEGUI::PushButton* button = static_cast<CEGUI::PushButton*>(
        CEGUI::WindowFactoryManager::getSingleton().getFactory("TaharezLook/Button")
        ->createWindow(buttonName));

    button->setText(Dictionary::instance().resolveString(name).c_str());
    button->setXPosition(BUTTON_X);
    button->setYPosition(BUTTON_Y);
    button->setWidth(BUTTON_WIDTH);
    button->setHeight(BUTTON_HEIGHT);
   button->setFont("Gotthard-8");


However, if I change the widget name to a falagard widget, the code doesn't work (it compiles, but it creates no widgets). This comes out in the log:

21/09/2005 15:33:08 (Error) Exception: WidgetLookManager::getWidgetLook - Widget look and feel '' does not exist.
21/09/2005 15:33:08 (Error) Exception: WidgetLookManager::getWidgetLook - Widget look and feel '' does not exist.
21/09/2005 15:33:08 (Error) Exception: WidgetLookManager::getWidgetLook - Widget look and feel '' does not exist.
21/09/2005 15:33:08 (Error) Exception: WidgetLookManager::getWidgetLook - Widget look and feel '' does not exist.
21/09/2005 15:33:08 (Error) Exception: WidgetLookManager::getWidgetLook - Widget look and feel '' does not exist.
21/09/2005 15:33:09 (Error) Exception: WidgetLookManager::getWidgetLook - Widget look and feel '' does not exist.
21/09/2005 15:33:09 (Error) Exception: WidgetLookManager::getWidgetLook - Widget look and feel '' does not exist.
21/09/2005 15:33:09 (Error) Exception: WidgetLookManager::getWidgetLook - Widget look and feel '' does not exist.
21/09/2005 15:33:09 (Error) Exception: WidgetLookManager::getWidgetLook - Widget look and feel '' does not exist.
21/09/2005 15:33:09 (Error) Exception: WidgetLookManager::getWidgetLook - Widget look and feel '' does not exist.
21/09/2005 15:33:09 (Error) Exception: WidgetLookManager::getWidgetLook - Widget look and feel '' does not exist.
21/09/2005 15:33:09 (Error) Exception: WidgetLookManager::getWidgetLook - Widget look and feel '' does not exist.


Why is it looking for a nameless widget? What's wrong?

Re: Existing code not working with Falagard

Posted: Wed Sep 21, 2005 21:47
by lindquist
You should'nt be creating windows through the WindowFactoryManager. Use WindowManager instead.

try this

Code: Select all

CEGUI::PushButton* button = static_cast<CEGUI::PushButton*>(
CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/Button",buttonName));