DeprecationWarning from the WxAgg backend

While trying out the new printing support in matplotlib 0.80's WxAgg backend, I encountered the following DeprecationWarning when calling FigureCanvasWxAgg.Printer_Preview().

   /usr/lib/python2.3/site-packages/wxPython/gdi.py:77: DeprecationWarning:
   integer argument expected, got float
     val = gdic.wxBitmap_SetWidth(self, *_args, **_kwargs)
   /usr/lib/python2.3/site-packages/wxPython/gdi.py:80: DeprecationWarning:
   integer argument expected, got float
     val = gdic.wxBitmap_SetHeight(self, *_args, **_kwargs)

A little digging located the problem in backend_wx.PrintoutWx.OnPrintPage() on lines 1906 and 1907. Wrapping a call to int() around the arguments of SetWidth() and SetHeight() there solves this problem.

I'm not sure that a two line change warrents a patch, but I'll happily submit one if asked.

Ken

Hi Ken,

Thanks for the report. It seems sort of odd that this
doesn't show up on Windows or Mac, but it does seem like
a fine idea to force the args of SetWidth, etc to be
integers.

I'll change this in cvs. Thanks!!

--Matt

···

On Mon, 16 May 2005, Ken McIvor wrote:

While trying out the new printing support in matplotlib 0.80's WxAgg backend,
I encountered the following DeprecationWarning when calling
FigureCanvasWxAgg.Printer_Preview().

   /usr/lib/python2.3/site-packages/wxPython/gdi.py:77: DeprecationWarning:
   integer argument expected, got float
     val = gdic.wxBitmap_SetWidth(self, *_args, **_kwargs)
   /usr/lib/python2.3/site-packages/wxPython/gdi.py:80: DeprecationWarning:
   integer argument expected, got float
     val = gdic.wxBitmap_SetHeight(self, *_args, **_kwargs)

A little digging located the problem in backend_wx.PrintoutWx.OnPrintPage() on
lines 1906 and 1907. Wrapping a call to int() around the arguments of
SetWidth() and SetHeight() there solves this problem.

I'm not sure that a two line change warrents a patch, but I'll happily submit
one if asked.

Ken

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel