Merge remote branch 'remotes/origin/bug_620_dvdburn_absolutepaths'
[enigma2.git] / lib / python / Components / VariableText.py
index 76dc201a4e6b5804c2a22362a2144b24857f37a0..c95330915c3af65b206df9f60308c65e436b1b4c 100644 (file)
@@ -1,28 +1,24 @@
-import skin
-
-class VariableText:
+class VariableText(object):
        """VariableText can be used for components which have a variable text, based on any widget with setText call"""
        
        def __init__(self):
+               object.__init__(self)
                self.message = ""
                self.instance = None
        
        def setText(self, text):
                self.message = text
                if self.instance:
-                       self.instance.setText(self.message)
+                       self.instance.setText(self.message or "")
+
+       def setMarkedPos(self, pos):
+               if self.instance:
+                       self.instance.setMarkedPos(int(pos))
 
        def getText(self):
                return self.message
        
-       def GUIcreate(self, parent):
-               self.instance = self.createWidget(parent)
-               self.instance.setText(self.message)
+       text = property(getText, setText)
        
-       def GUIdelete(self):
-               self.removeWidget(self.instance)
-               self.instance = None
-       
-       def removeWidget(self, instance):
-               pass
-
+       def postWidgetCreate(self, instance):
+               instance.setText(self.message or "")