GUI: child windows will no long be removed on parent destroy. listbox/window now...
authorFelix Domke <tmbinc@elitedvb.net>
Sat, 17 Dec 2005 16:00:50 +0000 (16:00 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Sat, 17 Dec 2005 16:00:50 +0000 (16:00 +0000)
lib/gui/elistbox.cpp
lib/gui/ewidget.cpp
lib/gui/ewidget.h
lib/gui/ewindow.cpp
lib/python/Components/GUISkin.py

index 013a310..21394de 100644 (file)
@@ -20,6 +20,9 @@ eListbox::eListbox(eWidget *parent)
 
 eListbox::~eListbox()
 {
+       if (m_scrollbar)
+               delete m_scrollbar;
+       
        ePtr<eActionMap> ptr;
        eActionMap::getInstance(ptr);
        ptr->unbindAction(this, 0);
index 023caa6..6f7fa91 100644 (file)
@@ -205,12 +205,11 @@ eWidget::~eWidget()
 
        m_parent = 0;
 
-               /* destroy all childs */
+               /* tell all childs that the parent is not anymore existing */
        ePtrList<eWidget>::iterator i(m_childs.begin());
        while (i != m_childs.end())
        {
-               (*i)->m_parent = 0;
-               delete *i;
+               (*i)->parentRemoved();
                i = m_childs.erase(i);
        }
 }
@@ -275,6 +274,11 @@ void eWidget::recalcClipRegionsWhenVisible()
        } while(1);
 }
 
+void eWidget::parentRemoved()
+{
+       m_parent = 0;
+}
+
 int eWidget::event(int event, void *data, void *data2)
 {
        switch (event)
index db86fd1..6739f25 100644 (file)
@@ -72,6 +72,8 @@ private:
        void doPaint(gPainter &painter, const gRegion &region);
        void recalcClipRegionsWhenVisible();
        
+       void parentRemoved();
+       
        gRGB m_background_color;
        int m_have_background_color;
        
index 54a3595..06827a9 100644 (file)
@@ -33,6 +33,7 @@ eWindow::eWindow(eWidgetDesktop *desktop): eWidget(0)
 eWindow::~eWindow()
 {
        getDesktop()->removeRootWidget(this);
+       m_child->destruct();
 }
 
 void eWindow::setTitle(const std::string &string)
index c953aae..cf8e189 100644 (file)
@@ -16,7 +16,7 @@ class GUISkin:
 
                for w in self.additionalWidgets:
                        w.instance = w.widget(parent)
-                       w.instance.thisown = 0
+                       w.instance.thisown = 0
                        applyAllAttributes(w.instance, desktop, w.skinAttributes)
                
                for f in self.onLayoutFinish: