add optional notification of childs when parent moves
[enigma2.git] / lib / python / Components / ChoiceList.py
index 91f18aeea27d95ffd3f302a755d681280eaa21bc..ca58ecd6b7bb3f559619dbad7027ef1e7a381941 100644 (file)
@@ -26,15 +26,18 @@ def ChoiceEntryComponent(key, text):
        
        return res
 
-class ChoiceList(HTMLComponent, GUIComponent, MenuList):
-       def __init__(self, list):
+class ChoiceList(MenuList, HTMLComponent, GUIComponent):
+       def __init__(self, list, selection = 0):
                GUIComponent.__init__(self)
                self.l = eListboxPythonMultiContent()
                self.list = list
                self.l.setList(list)
                self.l.setFont(0, gFont("Regular", 20))
-       
-       def GUIcreate(self, parent):
-               self.instance = eListbox(parent)
-               self.instance.setContent(self.l)
-               self.instance.setItemHeight(25)
+               self.selection = selection
+
+       GUI_WIDGET = eListbox
+               
+       def postWidgetCreate(self, instance):
+               instance.setContent(self.l)
+               instance.setItemHeight(25)
+               self.moveToIndex(self.selection)