[url removed]
This is the python code I pasted in, with a few harmless string edits.
Code: Select all
import pyjd # this is dummy in pyjs.
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.Button import Button
from pyjamas.ui.HTML import HTML
from pyjamas.ui.Label import Label
from pyjamas import Window
import pygwt
def greet(fred):
fred.setText("YOU CLICKITH MY BUTTON!!!!")
Window.alert("Hello, AJAX!")
if __name__ == '__main__':
pyjd.setup("public/Hello.html?fred=foo#me")
b = Button("Click me, for my hello world!!!", greet, StyleName='teststyle')
h = HTML("<b>Hi there! I'm testing some code!</b> (html)", StyleName='teststyle')
l = Label("Hello World (label)", StyleName='teststyle')
base = HTML("Hello from %s" % pygwt.getModuleBaseURL(),
StyleName='teststyle')
RootPanel().add(b)
RootPanel().add(h)
RootPanel().add(l)
RootPanel().add(base)
pyjd.run()
It's about 12 mb worth according to my chrome dev tools.
edit:
My mistake... I'm getting two different readings. One is when I do ctrl+shift+c, which gives lots of code, while right clicking and "view source code" shows 14 lines of html... Hmmm... odd.
edit:
Jeff, I'm just experimenting with pyjamas. I don't think Python is the best way to write Javascript, since that's probably what Javascript is for. And I still want to dive into Javascript, just not yet.