X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FComponents%2FVariableValue.py;h=288de01a43431aea06307f21a7d63a8d66c97bef;hp=8f0cef4c5ecc415f966554075ba3a6405e4208c7;hb=c0d78035b8c76e719bf7c05ff3812eb5a6ce9fe3;hpb=98c4b5bb004e9297bffa8e1c3572572741fda933 diff --git a/lib/python/Components/VariableValue.py b/lib/python/Components/VariableValue.py index 8f0cef4..288de01 100644 --- a/lib/python/Components/VariableValue.py +++ b/lib/python/Components/VariableValue.py @@ -1,27 +1,22 @@ 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) + self.instance.setValue(self.__value) 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)