Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 35 lines (27 sloc) 0.939 kB
0dee443 add pyjd support to onclicktest
lkcl authored
1 import pyjd # dummy in pyjs
2
7a39225 merge dynamic branch manually
lkcl authored
3 from pyjamas.ui.Button import Button
4 from pyjamas.ui.RootPanel import RootPanel
115b5c5 #80 - use import pyjamas always
lkcl authored
5 from pyjamas import Window
04ee480 first svn add of trunk
lkcl authored
6
7
8 def onButtonClick(sender):
9 Window.alert("function called")
10
3e3630b OnClickTest tidyup
Luke Kenneth Casson Leighton authored
11 class Object(object):
12 pass
04ee480 first svn add of trunk
lkcl authored
13
14 class OnClickTest:
3e3630b OnClickTest tidyup
Luke Kenneth Casson Leighton authored
15 def onModuleLoad(self):
16 def localFunc(sender):
17 Window.alert("anon object + local func called")
18 obj = Object()
19 setattr(obj, 'onClick', localFunc)
20 self.b = Button("function callback", onButtonClick)
21 self.b2 = Button("object callback", self)
22 self.b3 = Button("anon object + local func callback", obj)
23 RootPanel().add(self.b)
24 RootPanel().add(self.b2)
25 RootPanel().add(self.b3)
26
27 def onClick(self, sender):
28 Window.alert("object called")
bef2ab6 convert app loader to use __name__ == __main__
lkcl authored
29
30 if __name__ == '__main__':
0dee443 add pyjd support to onclicktest
lkcl authored
31 pyjd.setup("./OnClickTest.html") # dummy in pyjs
bef2ab6 convert app loader to use __name__ == __main__
lkcl authored
32 app = OnClickTest()
33 app.onModuleLoad()
0dee443 add pyjd support to onclicktest
lkcl authored
34 pyjd.run() # dummy in pyjs
Something went wrong with that request. Please try again.