Hej

this is my trace stack, do you get the same Rich?

Traceback (most recent call last):
  File "LW003.py", line 252, in <module>
    x = LW()
  File "LW003.py", line 238, in __init__
    self.game = Game(self)
  File "LW003.py", line 71, in __init__
    self.canvas = GWTCanvas(300, 150)
  File "C:\Users\Gustaf\tools\pyjamas\library\pyjamas\Canvas\GWTCanvas.py",
line 78, in __init__
    self.setPixelWidth(pixelX)
  File "C:\Users\Gustaf\tools\pyjamas\library\pyjamas\Canvas\GWTCanvas.py",
line 610, in setPixelWidth
    FocusWidget.setWidth(self, width)
  File "C:\Users\Gustaf\tools\pyjamas\library\pyjamas\ui\UIObject.py", line
222, in setWidth
    DOM.setStyleAttribute(self.element, "width", str(width))
  File "C:\Users\Gustaf\tools\pyjamas\library\pyjamas\DOM.py", line 897, in
setStyleAttribute
    element.style.setProperty(mash_name_for_glib(name), value, "")
  File "C:\Python26\lib\site-packages\comtypes\client\lazybind.py", line
163, in caller
    return self._comobj._invoke(descr.memid, descr.invkind, 0, *args)
  File "C:\Python26\lib\site-packages\comtypes\automation.py", line 664, in
_invoke
    dp, var, None, argerr)
_ctypes.COMError: (-2147024809, 'The parameter is incorrect.', (None, None,
None, 0, None))

(my pyjamas is a week or two old btw)

Now i follow the code backwards and what confuses me is this bit in
GWTCanvas.py:

    """*
    * Sets the CSS width in pixels for the canvas.
    *
    * @param width width of the canvas in pixels
    """
    def setPixelWidth(self, width):
        FocusWidget.setWidth(self, width)
        self.impl.setPixelWidth(self.getCanvasElement(), width)

First of all, i dont understand what the first line does. and second,
focuswidget expects a css style string, but gets an int(?).
Wonder what happens if i change it to FocusWidget.setWidth(self, str(width)
+ "px")... HOLY SHIT IT WORKS! (after doing the same to setHeight)

Checking pyjs, still works there too.

will submit patch!

G




On Tue, Feb 28, 2012 at 12:51 PM, Rich Newpol <[email protected]> wrote:

> I did a quick try on it and found it doesn't work for me either...however,
> according to the stack, it appears to be trying to use Canvas 2D for pyjd
> on windows (Usign GWTCanvasImplDefault) and I *think* it should be using
> the VML wrapper (GWTCanvasImplIE6) shouldn't it?
>
> Maybe it's a problem with the platform type recognition...
>
> R
>
>
> On Tue, Feb 28, 2012 at 6:58 AM, lkcl luke <[email protected]>wrote:
>
>> On Tue, Feb 28, 2012 at 11:37 AM, Gustaf Nilsson <[email protected]>
>> wrote:
>> > Looking forward to your svg canvas fix!
>> >
>> > It seems like neither the gwtcanvas demo or the raphael demo works in
>> pyjd
>> > (in Windows). Is that to be expected?
>>
>>  no it bloody well isn't!  ok, the raphael one is javascript, so
>> that's an automatic fail.  but the gwtcanvas one is critical!
>>
>>  can you please do some investigation?
>>
>>  thanks.
>>
>>  l.
>>
>
>


-- 
■ ■ ■ ■ ■ ■ ■ ■ ■ ■

Reply via email to