cleanup
[enigma2.git] / lib / python / Components / VariableText.py
1 import skin
2
3 class VariableText(object):
4         """VariableText can be used for components which have a variable text, based on any widget with setText call"""
5         
6         def __init__(self):
7                 object.__init__(self)
8                 self.message = ""
9                 self.instance = None
10         
11         def setText(self, text):
12                 self.message = text
13                 if self.instance:
14                         self.instance.setText(self.message)
15
16         def setMarkedPos(self, pos):
17                 if self.instance:
18                         self.instance.setMarkedPos(int(pos))
19
20         def getText(self):
21                 return self.message
22         
23         text = property(getText, setText)
24         
25         def postWidgetCreate(self, instance):
26                 instance.setText(self.message)