Having a small issue with subscribing events to an edit box, sadly there is no error output, its a memeory access error, however when I run the debugger the line it crashes on is the following.
Code: Select all
wMgr.getWindow("Input")->subscribeEvent(Editbox::EventTextAccepted,CEGUI::Event::Subscriber(&slGuiManager::handleInput, this));
I thought the format was correct but for some reason its causing a crash.
If i comment this line the program loads fine.
Here is a snippit of the surrounding code.
Code: Select all
//WindowManager& wMgr = WindowManager::getSingleton();
Editbox* ebox = (Editbox*)wMgr.createWindow("TaharezLook/Editbox","Input");
console->addChildWindow(ebox);
ebox->setPosition(Point(.05, .81));
ebox->setSize(Size(.9, .19));
wMgr.getWindow("Input")->subscribeEvent(CEGUI::Editbox::EventTextAccepted,CEGUI::Event::Subscriber(&slGuiManager::handleInput, this));
The commented line is to show that i have infact set the reference of wMgr to the manager singleton earlier on.
And finally the event handler code.
Code: Select all
bool slGuiManager::handleInput(const CEGUI::EventArgs& e)
{
return true;
}
yup it does alot
Anyway this has be quite baffled and i am hoping someone can point me in the right direction with this one.
I appricate any help you can offer =).
Thanks Much.