X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/47d24e1d25002485f1cb90f1682b4bc3070cad0b..9202d4248dd7df2f6e5eb53b4154c8297ec9b1d1:/components.py diff --git a/components.py b/components.py index 315ae44c..8ae48068 100644 --- a/components.py +++ b/components.py @@ -82,6 +82,10 @@ class Clock(HTMLComponent, GUIComponent, VariableText): VariableText.__init__(self) GUIComponent.__init__(self) self.doClock() + + self.clockTimer = eTimer() + self.clockTimer.timeout.get().append(self.doClock) + self.clockTimer.start(1000) # "funktionalitaet" def doClock(self): @@ -97,12 +101,20 @@ class Clock(HTMLComponent, GUIComponent, VariableText): return self.getText() class Button(HTMLComponent, GUIComponent, VariableText): - onClick = {} - def __init__(self, text=""): GUIComponent.__init__(self) VariableText.__init__(self) self.setText(text) + self.onClick = [ ] + + def clicked(self): + for x in self.onClick: + x() + return 0 + + def GUIcreate(self, priv, parent, skindata): + GUIComponent.GUIcreate(self, priv,parent, skindata) + priv["instance"].selected.get().append(self.clicked) def click(self): for x in self.onClick: