X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/98c4b5bb004e9297bffa8e1c3572572741fda933..8105da47caaa6e47246d73239d056491fa091ae5:/lib/python/Components/VariableValue.py diff --git a/lib/python/Components/VariableValue.py b/lib/python/Components/VariableValue.py index 8f0cef4c..feb45342 100644 --- a/lib/python/Components/VariableValue.py +++ b/lib/python/Components/VariableValue.py @@ -1,27 +1,23 @@ -import skin - -class VariableValue: +class VariableValue(object): """VariableValue can be used for components which have a variable value (like eSlider), based on any widget with setValue call""" def __init__(self): - self.value = 0 - self.instance = None - + self.__value = 0 + def setValue(self, value): - self.value = value + self.__value = value if self.instance: - self.instance.setValue(self.value) + try: + self.instance.setValue(self.__value) + except TypeError: + self.instance.setValue(0) def getValue(self): - return self.value - - def GUIcreate(self, parent): - self.instance = self.createWidget(parent) - self.instance.setValue(self.value) - - def GUIdelete(self): - self.removeWidget(self.instance) - self.instance = None - - def removeWidget(self, instance): - pass + return self.__value + + def postWidgetCreate(self, instance): + print self + print self.GUI_WIDGET + self.instance.setValue(self.__value) + + value = property(getValue, setValue)