closing, hiding or destroying a window , HELP!
Posted: Mon Nov 07, 2005 02:34
Please help!
I am not only new to CEGUI, but also a clumsy programmer.
I am working on GUI for a simulation program, in which i need to make windows that pop up and close on command.
I create pop up window lay out in xml sheet, and call loadWindowLayout when a button is clicked to display these windows. That works just fine.
The problems come when i try to make these windows disappear (after finish using them):
I have tried to hide them:
bool handleCancel(const CEGUI::EventArgs& e)
{
CEGUI::Window* mEditorGuiSheet = CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)"Load");
mEditorGuiSheet->hide();
return true;
}
I have tried to destroy them:
bool handleCancel(const CEGUI::EventArgs& e)
{
CEGUI::Window* mEditorGuiSheet = CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)"Load");
CEGUI::WindowManager::getSingleton().destroyWindow(mEditorGuiSheet);
return true;
}
and these 2 methods both help my program to CRASH.
I've read some where that destroying a window that fires event may make my program crash. What should i do to avoid it? Why doesn't the hide method work?
i have looked around for a while and still can't figure out how to close any of the window i create. I appreciate everymuch your help. please leave let me know if you need more information about the problems.
Thanks
I am not only new to CEGUI, but also a clumsy programmer.
I am working on GUI for a simulation program, in which i need to make windows that pop up and close on command.
I create pop up window lay out in xml sheet, and call loadWindowLayout when a button is clicked to display these windows. That works just fine.
The problems come when i try to make these windows disappear (after finish using them):
I have tried to hide them:
bool handleCancel(const CEGUI::EventArgs& e)
{
CEGUI::Window* mEditorGuiSheet = CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)"Load");
mEditorGuiSheet->hide();
return true;
}
I have tried to destroy them:
bool handleCancel(const CEGUI::EventArgs& e)
{
CEGUI::Window* mEditorGuiSheet = CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)"Load");
CEGUI::WindowManager::getSingleton().destroyWindow(mEditorGuiSheet);
return true;
}
and these 2 methods both help my program to CRASH.
I've read some where that destroying a window that fires event may make my program crash. What should i do to avoid it? Why doesn't the hide method work?
i have looked around for a while and still can't figure out how to close any of the window i create. I appreciate everymuch your help. please leave let me know if you need more information about the problems.
Thanks