diff options
| -rw-r--r-- | components.py | 12 | ||||
| -rw-r--r-- | mytest.py | 16 | ||||
| -rw-r--r-- | screens.py | 1 |
3 files changed, 25 insertions, 4 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: @@ -108,6 +108,8 @@ def test(): # button.resize(eSize(80, 50)) wnd.show() + + components["$002"].data["okbutton"]["instance"].push() for x in range(200): time.sleep(0.1) @@ -116,7 +118,7 @@ def test(): r = 200 - x else: r = x - components["$002"]["okbutton"].setValue(r) +# components["$002"]["okbutton"].setValue(r) desktop.paint() # @@ -131,3 +133,15 @@ def test(): return 0 + +def testI2(a): + print "PYTHON says: it's a " + str(a) + "!!!" + return 0 + +def testI(a = 0): + print "magic integer is " + str(a) + + list = testsignal.get() + print "list -> " + str(list) + list.append(testI2) + return 1 @@ -31,7 +31,6 @@ class clockDisplay(Screen): b = Button("bye") b.onClick = [ self.okbutton ] self["okbutton"] = b - #VolumeBar() self["title"] = Header("clock dialog: here you see the current uhrzeit!") # defined screens |
