1 from GUIComponent import *
3 from enigma import eListboxPythonMultiContent, eListbox, gFont
5 # [ ( actionmap, context, [(action, help), (action, help), ...] ), (actionmap, ... ), ... ]
7 class HelpMenuList(GUIComponent):
8 def __init__(self, list, callback):
9 GUIComponent.__init__(self)
11 self.l = eListboxPythonMultiContent()
12 self.callback = callback
15 for (actionmap, context, actions) in list:
17 print "actionmap:" + str(actionmap)
18 print "context: " + str(context)
19 print "actions: " + str(actions)
21 for (action, help) in actions:
24 entry.append( (actionmap, context, action) )
25 entry.append( (0, 36, 200, 20, 1, 0, "you can also press a secret button") )
26 entry.append( (0, 0, 200, 36, 0, 0, help) )
32 self.l.setFont(0, gFont("Arial", 36))
33 self.l.setFont(1, gFont("Arial", 18))
35 def GUIcreate(self, parent):
36 self.instance = eListbox(parent)
37 self.instance.setContent(self.l)
38 self.instance.setItemHeight(75)
41 self.instance.setContent(None)
45 # a list entry has a "private" tuple as first entry...
46 l = self.l.getCurrentSelection()[0]
48 # ...containing (Actionmap, Context, Action).
49 # we returns this tuple to the callback.
50 self.callback(l[0], l[1], l[2])