1 from HTMLComponent import *
2 from GUIComponent import *
4 from tools import CONNECT, DISCONNECT
6 from enigma import eInput, eInputContentString
8 class TextInput(HTMLComponent, GUIComponent):
10 GUIComponent.__init__(self)
11 self.content = eInputContentString()
13 def contentChanged(self):
14 print "content changed to %s!" % (self.getText())
17 return self.content.getText()
19 def setText(self, text):
20 # TODO : support unicode!
21 self.content.setText(str(text))
23 def GUIcreate(self, parent, skindata):
24 self.instance = eInput(parent)
25 CONNECT(self.instance.changed, self.contentChanged)
26 self.instance.setContent(self.content)
29 DISCONNECT(self.instance.changed, self.contentChanged)
30 self.instance.setContent(None)