Panel::~Panel()
{
- for(ChildSeq::iterator i=children.begin(); i!=children.end(); ++i)
- delete *i;
+ while(!children.empty())
+ delete children.front();
}
void Panel::add(Widget &wdg)
{
+ set_parent(wdg, this);
children.push_back(&wdg);
}
+void Panel::remove(Widget &wdg)
+{
+ ChildSeq::iterator i=find(children.begin(), children.end(), &wdg);
+ if(i!=children.end())
+ {
+ set_parent(wdg, 0);
+ children.erase(i);
+ }
+}
+
void Panel::button_press(int x, int y, unsigned btn)
{
if(pointer_grab>0)