im trying to load gui from xml and it works but once i try the subscribeEvent function the app crashes. here's the code:
Code: Select all
myRoot = WindowManager::getSingleton().loadWindowLayout( "editor2.layout" );
System::getSingleton().setGUISheet( myRoot );
WindowManager& winMgr = WindowManager::getSingleton();
Window* window = winMgr.getWindow("editor/win/save"); // window pointer ok!
//window->subscribeEvent(PushButton::EventClicked, Event::Subscriber(&GUITest::handleButton, gt)); // Crash !
its hard to debug because the crash happens inside cegui dll's. version im using is 0.7.1
can any one help?
(I just searched the forums and found out others have same problem... im using VS c++ 2008 express edition)
btw if u wonder the "gt" its from this code:
Code: Select all
class GUITest
{
public:
bool handleButton(const CEGUI::EventArgs& e)
{
MessageBox(0,"hmmm","button clicken",MB_OK);
return true;
}
};
GUITest * gt = new GUITest; // in main before crash code
