[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Uso di pyjamas e pyjamas-desktop



Sto tentando di usare pyjamas, nella versione pyjamas-desktop. Ho
preso dalla documentazione questo esempio di "hello world":

import pyjd

from pyjamas.ui.Button import Button
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.HTML import HTML
from pyjamas import Window

def greet(sender):
    Window.alert("Hello, AJAX!")

if __name__ == '__main__':
    b = Button("Click me", greet)
    RootPanel().add(b)
    hw = HTML("Hello <b>World</b>")
    RootPanel().add(hw)

e lo lancio con python Hello.py. Ottengo questo errore:

[...]
Traceback (most recent call last):
  File "Hello.py", line 12, in <module>
    b = Button("Click me", greet)
  File "/usr/share/pyjamas/library/pyjamas/ui/Button.py", line 36, in __init__
    element = DOM.createButton()
  File "/usr/share/pyjamas/library/pyjamas/DOM.py", line 190, in createButton
    return createElement("button")
  File "/usr/share/pyjamas/library/pyjamas/DOM.py", line 202, in createElement
    return doc().createElement(tag)
  File "/usr/share/pyjamas/library/__pyjamas__.py", line 45, in doc
    return main_frame.getDomDocument()
AttributeError: 'NoneType' object has no attribute 'getDomDocument'

Io credo di avere installato tutto correttamente, mi sono letto e
riletto i vari tutorial, eppure non "parte". Qualcuno ha avuto qualche
esperienza con pyjamas?

Sto utilizzando debian testing.

Grazie a tutti


Reply to: