X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/7c12c1089cfbee5b0a390d5f3de37f85de210263..13b7a9b397f36ca3195aad3702feb3db4cbb2f3e:/components.py diff --git a/components.py b/components.py index 315ae44c..7c793231 100644 --- a/components.py +++ b/components.py @@ -97,12 +97,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: