I'm trying to port an app to 2.5.1.5, and I want to retain support for 2.4.
The application relies heavily on OGL; these are the problems I've seen so
far with 2.5.1.5 (2.4.2.4 works fine) on XP, Python 2.3.3:
- before the program exits, I call ogl.OGLCleanup(); with 2.5.1.5, the
following appears on stdout:
Exception exceptions.TypeError: 'OGLCleanUp() takes exactly 0 arguments (1
given)' in <bound method __Cleanup.__del__ of <__main__.__Cleanup instance
at 0x017E5A80>> ignored
- I have a class derived from ogl.ShapeCanvas and I override OnLeftClick,
OnRightClick, etc. It looks like these methods do not get called in 2.5.1.5.
You can reproduce this e.g. editing the wxPython OGL demo and adding to
TestClass an OnLeftClick method printing something to self.log: nothing gets
printed when you left click on the canvas.
- I have the usual problems with the wx.DC methods. I am pleased to see from
other messages that in the next release the 2.4 code will work again.
- I don't know if/how this is related to wx.DC problems, but with wxPython
2.5.1.5 I get exceptions like the following one:
[...]
self.DrawPolygon(arrow)
File "C:\Python23\Lib\site-packages\wx\ogl.py", line 1790, in DrawPolygon
return _ogl.PyDrawnShape_DrawPolygon(*args, **kwargs)
TypeError: PyDrawnShape_DrawPolygon() takes at least 3 arguments (2 given)
where arrow is a list of tuples. self.DrawPolygon here is called in a class
derived from ogl.DrawnShape.
- this one is unrelated to OGL: with wxPython 2.5.1.5, wx.Font apparently
changed one of its named arguments from 'faceName' to 'face' so I would have
to try/except (or if/else looking at wx.VERSION) all calls to wx.Font. I
hope that the next version issues perhaps a deprecation warning if
'faceName' is such a bad argument name; certainly I was not expecting the
app to crash because of this. I wonder if there are other changes like this
one (which I could not find in the Migration Guide anyway).
I'm trying to port an app to 2.5.1.5, and I want to retain support for 2.4.
The application relies heavily on OGL; these are the problems I've seen so
far with 2.5.1.5 (2.4.2.4 works fine) on XP, Python 2.3.3:
- before the program exits, I call ogl.OGLCleanup(); with 2.5.1.5, the
following appears on stdout:
Exception exceptions.TypeError: 'OGLCleanUp() takes exactly 0 arguments (1
given)' in <bound method __Cleanup.__del__ of <__main__.__Cleanup instance
at 0x017E5A80>> ignored
Doesn't happen here...
- I have a class derived from ogl.ShapeCanvas and I override OnLeftClick,
OnRightClick, etc. It looks like these methods do not get called in 2.5.1.5.
You can reproduce this e.g. editing the wxPython OGL demo and adding to
TestClass an OnLeftClick method printing something to self.log: nothing gets
printed when you left click on the canvas.
This was a copy/paste problem. If you add the following to the end of PyShapeCanvas.__init__ then it should work for you:
self._setOORandCallbackInfo(PyShapeCanvas)
- I have the usual problems with the wx.DC methods. I am pleased to see from
other messages that in the next release the 2.4 code will work again.
- I don't know if/how this is related to wx.DC problems, but with wxPython
2.5.1.5 I get exceptions like the following one:
[...]
self.DrawPolygon(arrow)
File "C:\Python23\Lib\site-packages\wx\ogl.py", line 1790, in DrawPolygon
return _ogl.PyDrawnShape_DrawPolygon(*args, **kwargs)
TypeError: PyDrawnShape_DrawPolygon() takes at least 3 arguments (2 given)
where arrow is a list of tuples. self.DrawPolygon here is called in a class
derived from ogl.DrawnShape.
A typo in the typemap was preventing the right code from being generated. It's now fixed for the next release.
- this one is unrelated to OGL: with wxPython 2.5.1.5, wx.Font apparently
changed one of its named arguments from 'faceName' to 'face' so I would have
to try/except (or if/else looking at wx.VERSION) all calls to wx.Font.
Or just pass them as positional parameters.
I
hope that the next version issues perhaps a deprecation warning if
'faceName' is such a bad argument name; certainly I was not expecting the
app to crash because of this. I wonder if there are other changes like this
one (which I could not find in the Migration Guide anyway).
There was a lot of code reorganization and cleanup that sometimes resulted in resulted in parameter names being changed. Because the code was changing so much I wasn't able to track changes like parameter names (or we would still be waiting for 2.5...) It was hoped that with the new docstrings and the python-specific reference docs that are coming that param name changes would be easy to fix, but this one is easy to fix in wxFont so I'll do that.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!