Buckcherry
23-12-2008 15:36:37
Hi everybody,
I am trying to create a button which shutdown MyGUI when it is clicked.
For that, I have this:
The handleExitButtonClick method is:
When I click on the button, the following exception is trhown:
Any idea?
I am trying to create a button which shutdown MyGUI when it is clicked.
For that, I have this:
// Initialize MyGUI
mGuiMgr->initialise(mWindow);
// Button
MyGUI::ButtonPtr button = mGuiMgr->createWidget<MyGUI::Button>("Button", 10, 10, 300, 26, MyGUI::Align::Default/*MyGUI::ALIGN_DEFAULT - obsolete*/, "Main");
button->setCaption("exit");
button->eventMouseButtonClick = MyGUI::newDelegate(this, &LoginState::handleExitButtonClick);
The handleExitButtonClick method is:
void LoginState::handleExitButtonClick(MyGUI::WidgetPtr _sender)
{
mGuiMgr->shutdown();
delete mGuiMgr;
mGuiMgr = 0;
mInputMgr->removeKeyListener("loginKeyListener");
mInputMgr->removeMouseListener("loginMouseListener");
mWindow->removeAllViewports();
mRoot->destroySceneManager(mSceneMgr);
}
When I click on the button, the following exception is trhown:
OGRE EXCEPTION(10:MyGUIException): instance PointerManager was not created
Any idea?