- minor bugfix (allow empty content)
[enigma2.git] / components.py
index 20827180851a82e2900607631c17aff44605f535..76423387d25242b633a35e8126d21e53e7944552 100644 (file)
@@ -224,22 +224,20 @@ class VolumeBar(HTMLComponent, GUIComponent, VariableValue):
                g.setRange(0, 100)
                return g
 
+
 class MenuList(HTMLComponent, GUIComponent):
-       def __init__(self):
+       def __init__(self, list):
                GUIComponent.__init__(self)
+               self.l = eListboxPythonStringContent()
+               self.l.setList(list)
        
        def getCurrent(self):
                return self.l.getCurrentSelection()
        
        def GUIcreateInstance(self, priv, parent, skindata):
                g = eListbox(parent)
-               # BIG BIG HACK. :( we have to ensure that the eListboxPythonStringContent doesn't get destroyed.
-               # we really have to take a look at the GC stuff
-               self.l = eListboxPythonStringContent()
-               self.l.setList(["Test Object 1", "Item #2", "Item #3", "nun kommt eine Zahl:", 15, "Bla fasel", "lulabla"])
                g.setContent(self.l)
                return g
        
        def GUIdeleteInstance(self, g):
                g.setContent(None)
-               del self.l