Incompatable wxPython 'fixes'

<rant>

I just tried to run a little wxPython program, and it failed. The
reason is that the basic DC functions were renamed it a way that breaks
backward compatibility. I've been following the threads, and I
understand that wxPython people feel that this makes it more 'pythonic.'
But please realize that changing basic functionality makes a _lot_ of
work and frustration for a _lot_ of people.

Making things slightly more pythonic is not worth breaking
compatibility.

</rant>

So I just tried to run a wxPyPlot demo:

   http://www.cyberus.ca/~g_will/wxPython/wxpyplot.html

On my wxPython 2.5 and got the following result:

Traceback (most recent call last):
  File "C:\jimc\wxPyPlot.py", line 1387, in OnPlotDraw1
    self.resetDefaults()
  File "C:\jimc\wxPyPlot.py", line 785, in Draw
    ptx,pty,rectWidth,rectHeight= self._point2ClientCoord(p1, p2)
  File "C:\jimc\wxPyPlot.py", line 1202, in SetClippingRegion
    def SetClippingRegion(self, x, y, width, height):
  File "C:\apps\PYTHON~1\Lib\site-packages\wx\gdi.py", line 2597, in
SetClipping
Region
    return _gdi.DC_SetClippingRegion(*args, **kwargs)
TypeError: DC_SetClippingRegion() takes exactly 3 arguments (5 given)
Traceback (most recent call last):
  File "C:\jimc\wxPyPlot.py", line 1405, in OnPlotDraw4
    drawObj= _draw4Objects()
  File "C:\jimc\wxPyPlot.py", line 697, in Draw
    dc = FloatDCWrapper(wx.wxBufferedDC(wx.wxClientDC(self),
self._Buffer))
  File "C:\apps\PYTHON~1\Lib\site-packages\wx\gdi.py", line 3043, in
__init__
    newobj = _gdi.new_BufferedDC(*args)
wx.core.PyAssertionError: C++ assertion "wxAssertFailure" failed in
..\..\src\ms
w\dcmemory.cpp(133): Couldn't select a bitmap into wxMemoryDC

Is there any quick way to fix this? (Short of editing the application
and adding xy on all of the DC calls?

-Jim

James Carroll wrote:

So I just tried to run a wxPyPlot demo:

   http://www.cyberus.ca/~g_will/wxPython/wxpyplot.html

Is there any quick way to fix this? (Short of editing the application
and adding xy on all of the DC calls?

Use the PyPlot that comes with wxPython...it works with 2.5. It's the same one as you downloaded, though perhaps a different version. (Actually, it's obviously a different version, 'cause it works with 2.5)

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

James Carroll wrote:

<rant>

I just tried to run a little wxPython program, and it failed. The
reason is that the basic DC functions were renamed it a way that breaks
backward compatibility. I've been following the threads, and I
understand that wxPython people feel that this makes it more 'pythonic.'
But please realize that changing basic functionality makes a _lot_ of
work and frustration for a _lot_ of people.

Making things slightly more pythonic is not worth breaking
compatibility.

This change is going to be reverted.

Is there any quick way to fix this? (Short of editing the application
and adding xy on all of the DC calls?

See my next message.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!