From: Werner F. B. <wer...@fr...> - 2005-04-10 17:00:22
|
Hi Chris, A small correction to the patch for backend_wx.py. if wxPlatform == '__WXMSW__': on line 638 or there abouts needs to be changed See you Werner Werner F. Bruhin wrote: > Hi Chris, > > Attached are three patches to convert things to the new wx namespace. I > am very new to matplotlib, so it might be a good idea if someone with > more matplotlib and wxPython experience checks these out. > > See you > Werner > > Chris Barker wrote: > >> >>>> (XP), I see that lines 116-117 are commented. These lines are: >>>> >>>> # wxapp = wxPySimpleApp() >>>> # wxapp.SetExitOnFrameDelete(True) >> >> >> >> The wxApp should NOT be created here! However, if there seems to be a >> reason that it has to be, perhaps these lines could be surrounded by a >> check to see if there is already a wxApp running. >> >> Robin, is there a call to do that? Maybe: >> >> if not wxGetApp(): >> wxapp = wxPySimpleApp() >> wxapp.SetExitOnFrameDelete(True) >> >> I just tested this quickly, and wxGetApp() returns None before app >> creation, and a wxApp instance after, which returns True, so it should >> work. >> >> For that matter, maybe wx.PySimpleApp() should check itself, and never >> create a duplicate app. >> >> By the way, it really should be: >> >> import wx >> >> wx.PySimpleApp() >> >> etc. >> >> Maybe I'll get around to cleaning up that code some day! >> >> -Chris >> >> > |