init
[open-duckbox-project-sh4:theseus-tdt.git] / tdt / cvs / apps / enigma2 / lib / python / Components / Converter / StaticMultiList.py
1 from enigma import eListboxPythonMultiContent
2 from Components.Converter.StringList import StringList
3
4 class StaticMultiList(StringList):
5         """Turns a python list in 'multi list format' into a list which can be used in a listbox."""
6         def changed(self, what):
7                 if not self.content:
8                         self.content = eListboxPythonMultiContent()
9
10                         if self.source:
11                                 # setup the required item height, as given by the source.
12                                 self.content.setItemHeight(self.source.item_height)
13                         
14                                 # also setup fonts (also given by source)
15                                 index = 0
16                                 for f in self.source.fonts:
17                                         self.content.setFont(index, f)
18                                         index += 1
19
20                 if self.source:
21                         self.content.setList(self.source.list)
22
23                 print "downstream_elements:", self.downstream_elements
24                 self.downstream_elements.changed(what)