Existing code not working with Falagard

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
SupSuper
Just popping in
Just popping in
Posts: 17
Joined: Mon Feb 07, 2005 16:17
Location: Portugal
Contact:

Existing code not working with Falagard

Postby SupSuper » Wed Sep 21, 2005 14:41

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?

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: Existing code not working with Falagard

Postby lindquist » Wed Sep 21, 2005 21:47

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));


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 3 guests