summaryrefslogtreecommitdiff
path: root/src/gui/widgets/container.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/container.cpp')
-rw-r--r--src/gui/widgets/container.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/widgets/container.cpp b/src/gui/widgets/container.cpp
index b788b0610..f6281d578 100644
--- a/src/gui/widgets/container.cpp
+++ b/src/gui/widgets/container.cpp
@@ -31,3 +31,17 @@ Container::~Container()
while (!mWidgets.empty())
delete mWidgets.front();
}
+
+bool Container::safeRemove(gcn::Widget* widget)
+{
+ WidgetListIterator iter;
+ for (iter = mWidgets.begin(); iter != mWidgets.end(); ++iter)
+ {
+ if (*iter == widget)
+ {
+ remove(widget);
+ return true;
+ }
+ }
+ return false;
+} \ No newline at end of file