aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Components/TextInput.py
blob: 98b440c5bd604cf4d2032ed7f2cb17ca228efb78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from HTMLComponent import *
from GUIComponent import *

from tools import CONNECT, DISCONNECT

from enigma import eInput, eInputContentString

class TextInput(HTMLComponent, GUIComponent):
	def __init__(self):
		GUIComponent.__init__(self)
		self.content = eInputContentString()

	def contentChanged(self):
		print "content changed to %s!" % (self.getText())
	
	def getText(self):
		return self.content.getText()
	
	def setText(self, text):
		# TODO :  support unicode!
		self.content.setText(str(text))
	
	def GUIcreate(self, parent, skindata):
		self.instance = eInput(parent)
		CONNECT(self.instance.changed, self.contentChanged)
		self.instance.setContent(self.content)
	
	def GUIdelete(self):
		DISCONNECT(self.instance.changed, self.contentChanged)
		self.instance.setContent(None)
		self.instance = None