Clearing the GUI
-
- Posts: 15
- Joined: Thu Dec 04, 2003 11:09 am
- Location: London UK
- Contact:
Clearing the GUI
Is there a way to clear all the elements I've added to an IGUIEnvironment in one command? As far as I can see, I have to keep pointers to all my elements and then remove them individually, which is something I'm not too keen on doing .
November235 - Are you in FINAL DENIAL?
Land - Air - Sea
Land - Air - Sea
-
- Posts: 15
- Joined: Thu Dec 04, 2003 11:09 am
- Location: London UK
- Contact:
gui gui everywhere but not a drop to drink
or you could add this function to IGUIElement.h
then call
from your project
Code: Select all
//! Removes All Children
virtual void removeChildren() {
// delete all children
core::list<IGUIElement*>::Iterator it = Children.begin();
while (it != Children.end()) {
(*it)->Parent = 0;
(*it)->drop();
it = Children.erase(it);
}
}
Code: Select all
void ClearGui() {
irr::gui:: IGUIElement* ele = grr.env->getRootGUIElement();
ele->removeChildren();
}