FormPanel error when trying to use example from pyjamas book #736

Open
piet8stevens opened this Issue Jun 10, 2012 · 5 comments

Comments

Projects
None yet
2 participants

When I try to execute the FormPanelExample.py from the examples directory, I get the following result:
~/pyjamas/examples/formpanel$ python FormPanelExample.pyset_main_frame <pyjd.pywebkitgtknew.Browser instance at 0xa436cec>
Traceback (most recent call last):
File "FormPanelExample.py", line 79, in
app.onModuleLoad()
File "FormPanelExample.py", line 55, in onModuleLoad
RootPanel().add(self.form)
File "/home/pstevens/pyjamas/library/pyjamas/ui/AbsolutePanel.py", line 30, in add
ComplexPanel.add(self, widget, self.getElement())
File "/home/pstevens/pyjamas/library/pyjamas/ui/ComplexPanel.py", line 26, in add
self.insert(widget, container, self.getWidgetCount())
File "/home/pstevens/pyjamas/library/pyjamas/ui/ComplexPanel.py", line 44, in insert
self.adopt(widget, container)
File "/home/pstevens/pyjamas/library/pyjamas/ui/Panel.py", line 107, in adopt
widget.setParent(self)
File "/home/pstevens/pyjamas/library/pyjamas/ui/Widget.py", line 138, in setParent
self.onAttach()
File "/home/pstevens/pyjamas/library/pyjamas/ui/FormPanel.py", line 193, in onAttach
self.hookEvents(self.iframe, self.getElement(), self)
File "/home/pstevens/pyjamas/library/pyjamas/ui/FormPanel.py", line 141, in hookEvents
self._onload_listener = mf.addEventListener(iframe, "load",
AttributeError: Browser instance has no attribute 'addEventListener'

Other examples such as Hello or FlowPanel do work.
I have done a git pull in order to get the latest versions of pyjs.
Running ubuntu 12.04.
Running 0.8.1~+alpha1 (that is what I get from CHANGELOG - not sure where else to get the version from).

Member

anthonyrisinger commented Jun 12, 2012

which runtime/browser engine are you using, and what platform are you on (windows/mac/linux/...)?

Ubuntu 12.04
pyjs 0.8.1+alpha1
It happened when I run it outside of the browser.

Member

anthonyrisinger commented Jun 13, 2012

are you using the .deb package from here:

https://github.com/pyjs/pyjs/downloads

... the native runtimes do not work out of the box, they require modified versions of WebKit/XULRunner. this may change in the near future, for WebKit anyway.

the Trident/Windows runtime works with the comtypes python package.

Member

anthonyrisinger commented Jun 13, 2012

ah nevermind, i didn't realize you were the same person as the recent on-list question :-)

so, you are using the deb package, but you said you rebuilt it? correct? what have you done custom/etc or tried thus far? i haven't had a chance to rebuild pythonwebkit yet, but the native engines are a little fragile so i need to ensure your setup is not causing the issue.

--- Source/JavaScriptCore/wtf/gobject/GTypedefs.h.orig 2012-05-10 00:09:14.000000000 -0400
+++ Source/JavaScriptCore/wtf/gobject/GTypedefs.h 2012-05-10 00:06:13.000000000 -0400
@@ -52,7 +52,7 @@
typedef struct _GHashTable GHashTable;
typedef struct _GInputStream GInputStream;
typedef struct _GList GList;
-typedef struct _GMutex GMutex;
+typedef union _GMutex GMutex;
typedef struct _GPatternSpec GPatternSpec;
typedef struct _GPollableOutputStream GPollableOutputStream;
typedef struct _GSocketClient GSocketClient;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment