- add separation lines to the ChoiceList component
[enigma2.git] / lib / python / Screens / ChoiceBox.py
index f38f0363dd7f1e00e0edc4bc6acfa0a7b977bb73..60aa5e10452fd9fa75e0594021fc8fee807fc60a 100644 (file)
@@ -10,7 +10,7 @@ from Components.ChoiceList import ChoiceEntryComponent, ChoiceList
 import os
 
 class ChoiceBox(Screen):
-       def __init__(self, session, title = "", list = [], keys = None):
+       def __init__(self, session, title = "", list = [], keys = None, selection = 0):
                Screen.__init__(self, session)
 
                self["text"] = Label(title)
@@ -24,11 +24,11 @@ class ChoiceBox(Screen):
                pos = 0
                for x in list:
                        strpos = str(self.keys[pos])
-                       self.list.append(ChoiceEntryComponent(strpos, x))
+                       self.list.append(ChoiceEntryComponent(key = strpos, text = x))
                        if self.keys[pos] != "":
                                self.keymap[self.keys[pos]] = list[pos]
                        pos += 1
-               self["list"] = ChoiceList(self.list)
+               self["list"] = ChoiceList(list = self.list, selection = selection)
                                
                self["actions"] = NumberActionMap(["WizardActions", "InputActions", "ColorActions"], 
                {