add missing Network.py
[enigma2.git] / lib / python / Components / Button.py
1 from HTMLComponent import *
2 from GUIComponent import *
3 from VariableText import *
4
5 from enigma import eButton
6
7 class Button(HTMLComponent, GUIComponent, VariableText):
8         def __init__(self, text="", onClick = [ ]):
9                 GUIComponent.__init__(self)
10                 VariableText.__init__(self)
11                 self.setText(text)
12                 self.onClick = onClick
13         
14         def push(self):
15                 for x in self.onClick:
16                         x()
17                 return 0
18         
19         def disable(self):
20 #               self.instance.hide()
21                 pass
22         
23         def enable(self):
24 #               self.instance.show()
25                 pass
26
27 # html:
28         def produceHTML(self):
29                 return "<input type=\"submit\" text=\"" + self.getText() + "\">\n"
30
31 # GUI:
32         def createWidget(self, parent):
33                 g = eButton(parent)
34                 g.selected.get().append(self.push)
35                 return g
36
37         def removeWidget(self, w):
38                 w.selected.get().remove(self.push)
39