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