wxmpl and refresh problem

Massimiliano Costacurta massi_srb at msn.com
Fri May 4 02:36:58 PDT 2007


Hi everyone, I'm trying to use matplotlib via wxmpl, but I've got some prob=
lems using it on windowsXP (python 2.5, wxpython 2.8). I post a piece of co=
de to explain it.  =

 =

import wx,wxmpl,numpy =

 =

def plotfunc(e, axes):     f=3D(numpy.arange(-100,101)/100.)**e     axes.pl=
ot(f) =

 =

class MyMenu(wx.Frame):    def __init__(self, parent, id, title):        wx=
.Frame.__init__(self, parent, id, title, wx.DefaultPosition, wx.Size(1100, =
900))        panel=3Dwxmpl.PlotPanel(self, -1)        figure=3Dpanel.get_fi=
gure()         axes=3Dfigure.gca()         for i in range(10):             =
plotfunc(i, axes)         self.Centre()        self.Bind(wx.EVT_MENU, self.=
OnQuit, id=3D105)
    def OnQuit(self, event):        self.Close()
 =

class MyApp(wx.App):    def OnInit(self):        frame =3D MyMenu(None, -1,=
 'graph')        frame.Show(True)        return True
 =

app =3D MyApp(0)app.MainLoop()
 =

If you run the program you'll see that the crosshair "dirties" the plot. I'=
ve got the same trouble if I reduce the window to icon and then maximize it=
. I suppose this is due to a refresh problem, but I don't know how I can so=
lve it. I even took a look to the code of wxmpl.py and the only thing I fou=
nd was that there is a "onEraseBackgroundMethod" method which is not overri=
dden. Does it deal with the problem? Can anyone help me?
Thanks in advance,
Massi
_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200705=
04/6df0c5f8/attachment.htm


More information about the wxpython-users mailing list