blob: d773b2c10d16c2b81213f9a12969e28e0e0b7e1c (
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
32
33
34
35
36
37
38
39
|
from HTMLComponent import *
from GUIComponent import *
from VariableText import *
from enigma import eButton
class Button(HTMLComponent, GUIComponent, VariableText):
def __init__(self, text="", onClick = [ ]):
GUIComponent.__init__(self)
VariableText.__init__(self)
self.setText(text)
self.onClick = onClick
def push(self):
for x in self.onClick:
x()
return 0
def disable(self):
# self.instance.hide()
pass
def enable(self):
# self.instance.show()
pass
# html:
def produceHTML(self):
return "<input type=\"submit\" text=\"" + self.getText() + "\">\n"
# GUI:
def createWidget(self, parent, skindata):
g = eButton(parent)
g.selected.get().append(self.push)
return g
def removeWidget(self, w):
w.selected.get().remove(self.push)
|