Pyjamas book example code does not run as is. #13

Open
pyjsorg opened this Issue Apr 27, 2012 · 1 comment

Comments

Projects
None yet
1 participant
Contributor

pyjsorg commented Apr 27, 2012

Before reporting a problem, please UPDATE TO LATEST SVN.
As this is a community-driven project, the developers only
have time available to fix problems reported in the LATEST
code. You are welcome to report problems in any other
version, but until you have upgraded to latest svn and provided
a test report against that, you will be reliant on people
OTHER than the core developers for bug-fixes. which could
happen, so feel free to ignore the above should you so choose.

What steps will reproduce the problem?
1.Copy the code for class AbsolutePanelDemo from the book into a file and create an AbsolutePanelDemo.
2.
3.

What is the expected output? What do you see instead?
Expected output: normally running application with an AbsolutePanelDemo in the application window.
You will get an error about this line:DOM.setIntAttribute(wrapper.getTable(), "cellPadding", 10): set_main_frame <pyjd.pywebkitgtknew.Browser instance at 0x9445a6c>
Traceback (most recent call last):
File "/home/xxx/workspace/Hello/Hello.py", line 51, in <module>
ap = AbsolutePanelDemo()
File "/home/xxx/workspace/Hello/AbsolutePanelDemo.py", line 15, in init
panel.add(self.makeBox("Child 1"), 20, 10)
File "/home/xxx/workspace/Hello/AbsolutePanelDemo.py", line 27, in makeBox
DOM.setIntAttribute(wrapper.getTable(), "cellPadding", 5)
File "/home/xxx/pyjamas/library/pyjamas/DOM.py", line 879, in setIntAttribute
setattr(elem, attr, int(value))
TypeError: _wrap_corehtmltableelement__set_cellPadding() argument must be string, not int .

What version of Pyjamas are you using? which svn revision number?
On what operating system?
OS: Ubuntu, 11.10
Pyjamas: 0.8alpha1

If using PyJS, have you attached a javascript stack trace,
from IE's Script Debugger or from Firefox Venkman / Firebug?
Have you attached a stack trace from using "-d" compiler option?
I got the error from Pyjamas-Desktop

If using PyJD, have you attached a python stack trace?
See above.

If using PyJS, what compiler options did you use?

Please provide any additional information below.
Additional errors on the example code for http://pyjs.org/book/output/Bookreader.html#UI%20Module (UI Module): all eventhandlers such as onClose(self) lack 1 parameter. If you try to run this code, it gives an error that some function needs 2 parameters. The solution is to modify the code to onClose(self, sender). Same for hideRows and showRows a bit down on the same page - in FlexTableDemo.

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=710 (April 08, 2012 18:49:50)

Contributor

pyjsorg commented Apr 29, 2012

From luke.lei...@gmail.com on April 28, 2012 02:16:16:
thanks for this - yeah i believe you may be one of the few rare people who's tried these examples, which are a little old, pre-dating some of the strictness that's been added since (proper parameter checking for function calls)

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