Hi,
I am still getting crashes using the WX backend with the latest SVN.
For example:
In [1]: figure()
------------------------------------------------------------
Traceback (most recent call last):
File
"/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py",
line 1092, in _onSize
self.draw()
File
"/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py",
line 892, in draw
self.figure.draw(self.renderer)
File "/usr/lib/python2.5/site-packages/matplotlib/figure.py", line
724, in draw
if self.frameon: self.patch.draw(renderer)
File "/usr/lib/python2.5/site-packages/matplotlib/patches.py", line
257, in draw
gc = renderer.new_gc()
File
"/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py",
line 366, in new_gc
self.gc = GraphicsContextWx(self.bitmap, self)
File
"/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py",
line 463, in __init__
gfx_ctx = wx.GraphicsContext.Create(dc)
<type 'exceptions.AttributeError'>: 'module' object has no attribute
'GraphicsContext'
It appears that this GraphicsContext either isn't in my version of
wxPython or isn't initialized properly. Updating to wxPython 2.8 fixed
the problem, but I think that breaks other things on my system (like
system tools on Ubuntu that I need to use). For now I will just use
2.8, but I may have to revert. Is supporting wx 2.6 a goal?
Cheers,
David
On Thu, 2008-07-24 at 11:55 -0400, Paul Kienzle wrote:
> On Thu, Jul 24, 2008 at 05:14:42PM +0200, David Kaplan wrote:
> > Hi,
> >
> > No, it doesn't appear to work with or without my changes. Also, it
> > looks to me like the following code is now misplaced in backend_wx.py:
> >
> > # Event binding code changed after version 2.5
> > if wx.VERSION_STRING >= '2.5':
> > def bind(actor,event,action,**kw):
> > actor.Bind(event,action,**kw)
> > else:
> > def bind(actor,event,action,id=None):
> > if id is not None:
> > event(actor, id, action)
> > else:
> > event(actor,action)
> >
> > It now appears after some functions not in the class. Is this OK?
>
> This code is not part of any class. Anyway, I moved it to the top
> of the file.
>
> > Also, I noticed that this defines bind, while elsewhere in the class
> > self.Bind is used. Is this correct? If so, should these other
> > references perhaps take advantage of your abstraction?
>
> I've committed a change so that all functions now use
>
> bind(self, wx.EVT, callback, id=id)
>
> rather than
>
> if wx.VERSION_STRING >= '2.5':
> self.Bind(wx.EVT,callback,id=id)
> else:
> wx.EVT(self, id, callback)
>
> I'm not set up to test against wx < 2.5, though given its age
> and the small user base of matplotlib wx, I'm not sure that
> it is relevant anymore.
>
>
> - Paul
>
--
**********************************
David M. Kaplan
Charge de Recherche 1
Institut de Recherche pour le Developpement
Centre de Recherche Halieutique Mediterraneenne et Tropicale
av. Jean Monnet
B.P. 171
34203 Sete cedex
France
Phone: +33 (0)4 99 57 32 27
Fax: +33 (0)4 99 57 32 95
http://www.ur097.ird.fr/team/dkaplan/index.html
**********************************
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel