diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2005-01-18 06:56:52 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2005-01-18 06:56:52 +0000 |
| commit | 13b7a9b397f36ca3195aad3702feb3db4cbb2f3e (patch) | |
| tree | 26ae22a439b1845c4ec6ac438f59c733e1cad4c5 /components.py | |
| parent | 7c12c1089cfbee5b0a390d5f3de37f85de210263 (diff) | |
| download | enigma2-13b7a9b397f36ca3195aad3702feb3db4cbb2f3e.tar.gz enigma2-13b7a9b397f36ca3195aad3702feb3db4cbb2f3e.zip | |
slightly better example of using the signals (eButton::selected -> Button::onClick -> Screen "closed!")
Diffstat (limited to 'components.py')
| -rw-r--r-- | components.py | 12 |
1 files changed, 10 insertions, 2 deletions
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: |
