summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-07 18:03:09 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-07 18:03:09 +0200
commitb2ce88bae2b95adb612456d9659669d6b686de7b (patch)
treeb165a1f2a98c4c99ce1c0a142a53e71f3d0b3b00 /src/gui/widgets
parent2c765dc21314b1b32f7a75686571127f8af38bf9 (diff)
downloadmv-b2ce88bae2b95adb612456d9659669d6b686de7b.tar.gz
mv-b2ce88bae2b95adb612456d9659669d6b686de7b.tar.bz2
mv-b2ce88bae2b95adb612456d9659669d6b686de7b.tar.xz
mv-b2ce88bae2b95adb612456d9659669d6b686de7b.zip
Add ability to show/hide buttons in top right window corner.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/container.cpp14
-rw-r--r--src/gui/widgets/container.h4
2 files changed, 18 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
diff --git a/src/gui/widgets/container.h b/src/gui/widgets/container.h
index c2696a65f..5b7c281c9 100644
--- a/src/gui/widgets/container.h
+++ b/src/gui/widgets/container.h
@@ -22,6 +22,7 @@
#ifndef GUI_CONTAINER_H
#define GUI_CONTAINER_H
+#include <guichan/widget.hpp>
#include <guichan/widgets/container.hpp>
/**
@@ -37,7 +38,10 @@ class Container : public gcn::Container
{
public:
Container();
+
~Container();
+
+ bool safeRemove(gcn::Widget* widget);
};
#endif