aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/VariableValue.py
blob: 288de01a43431aea06307f21a7d63a8d66c97bef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import skin

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)