diff options
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/tabbedarea.cpp | 18 | ||||
-rw-r--r-- | src/gui/widgets/tabbedarea.h | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 6c2ef5b25..b20237c1b 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -442,6 +442,24 @@ gcn::Widget *TabbedArea::getWidgetByIndex(int index) const return mTabs[index].second; } +void TabbedArea::removeAll() +{ + if (getSelectedTabIndex() != -1) + { + setSelectedTab(static_cast<unsigned int>(0)); + + } + while (getNumberOfTabs() > 0) + { + const int idx = getNumberOfTabs() - 1; + gcn::Tab *tab = mTabs[idx].first; + Widget *widget = mTabs[idx].second; + removeTab(tab); + delete tab; + delete widget; + } +} + /* void TabbedArea::moveLeft(gcn::Tab *tab) { diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index dccf72357..d6f0783df 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -108,6 +108,8 @@ class TabbedArea : public gcn::TabbedArea, public gcn::WidgetListener */ void removeTab(gcn::Tab *tab); + void removeAll(); + /** * Overload the logic function since it's broken in guichan 0.8. */ |