diff --git a/headers/os/interface/LayoutItem.h b/headers/os/interface/LayoutItem.h index 851fdd031c..82dd03fee5 100644 --- a/headers/os/interface/LayoutItem.h +++ b/headers/os/interface/LayoutItem.h @@ -23,6 +23,7 @@ public: virtual ~BLayoutItem(); BLayout* Layout() const; + bool RemoveSelf(); virtual BSize MinSize() = 0; virtual BSize MaxSize() = 0; diff --git a/src/kits/interface/LayoutItem.cpp b/src/kits/interface/LayoutItem.cpp index 5ef6cab9c5..4cfc01e2c3 100644 --- a/src/kits/interface/LayoutItem.cpp +++ b/src/kits/interface/LayoutItem.cpp @@ -47,6 +47,13 @@ BLayoutItem::Layout() const } +bool +BLayoutItem::RemoveSelf() +{ + return Layout() != NULL && Layout()->RemoveItem(this); +} + + void BLayoutItem::SetExplicitSize(BSize size) {