aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/VariableValue.py
blob: 7fde0af1730b65473eed3db53d8b7843469fe34d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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

	def setValue(self, value):
		self.__value = value
		if self.instance:
			self.instance.setValue(self.__value)

	def getValue(self):
		return self.__value

	def postWidgetCreate(self, instance):
		print self
		print self.GUI_WIDGET
		self.instance.setValue(self.__value)

	value = property(getValue, setValue)