I am making my main menu and i got a serious problem with TabControls.
All other GUI elements have an "x" button included which allows to close it.
But there's none with the tabControl one. I use a button to open up my tabcontrol which i want to use for my settings, here's the code :
Code: Select all
if (id == 102) // Settings
{
tabctrl = guienv->addTabControl(core::rect<int>(100,100,540,380),
0, true, true);
videoTab = tabctrl->addTab(L"Video");
inputTab = tabctrl->addTab(L"Input");
soundTab = tabctrl->addTab(L"Sound");
x1 = guienv->addButton(core::rect<int>(420,5,435,20), videoTab, 1, L"x");
x2 = guienv->addButton(core::rect<int>(420,5,435,20), inputTab, 1, L"x");
x3 = guienv->addButton(core::rect<int>(420,5,435,20), soundTab, 1, L"x");
return true;
}
the only thing i need is a part of code my "x" buttons to close the tabcontrol so i can come back to my main menu.
I tried using the remove(); and the removeChildren(); functions, calling them to delete the 3 buttons, the 3 tabs and the tabcontrol, it compiles, but i get a "unhandled exception" when i try to quit the tabcontrol with my "x" buttons. Anybody can help? just tell me what would be the right way to delete the tabcontrol without getting any "unhandled exception" (which i think is caused by ressources that haven't been destroyed).
any help would be great, thanks