-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:
def getText(self):
return self.message
- def GUIcreate(self, parent):
- self.instance = self.createWidget(parent)
- self.instance.setText(self.message)
-
- def GUIdelete(self):
- self.removeWidget(self.instance)
- self.instance = None
+ text = property(getText, setText)
- def removeWidget(self, instance):
- pass
-
+ def postWidgetCreate(self, instance):
+ instance.setText(self.message or "")