PageRenderTime 146ms CodeModel.GetById 63ms RepoModel.GetById 17ms app.codeStats 0ms

/examples/onclicktest/OnClickTest.py

http://pyjamas.googlecode.com/
Python | 21 lines | 12 code | 9 blank | 0 comment | 0 complexity | 1a6e399df01b6c55ec6ec38125c46609 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. from ui import Button, RootPanel
  2. import Window
  3. def onButtonClick(sender):
  4. Window.alert("function called")
  5. class OnClickTest:
  6. def onModuleLoad(self):
  7. self.b = Button("function callback", onButtonClick)
  8. self.b2 = Button("object callback", self)
  9. RootPanel().add(self.b)
  10. RootPanel().add(self.b2)
  11. def onClick(self, sender):
  12. Window.alert("object called")