On Sun, Jul 27, 2008 at 7:43 AM, Paul Kienzle <[EMAIL PROTECTED]> wrote: > On Sat, Jul 26, 2008 at 7:26 PM, John Hunter <[EMAIL PROTECTED]> wrote: >> But this example revealed a serious problem for wxagg -- the wx >> backend save method was getting triggered. So wxagg couuld display an >> image, but if we try to save it, it fails because backend_wx's >> print_figure is getting called. I fixed this by reversing the order >> of the inheritance in FigureCanvasWXAgg so that FigureCanvasAgg is >> first. *please test*. > > That one is my fault. I was having trouble getting start_event_loop > and draw_idle from Wx to trigger from WxAgg. I have no explanation > why it works now with Agg before Wx --- Agg should pick up the default > draw_idle from Base so WxAgg shouldn't try to look for it in Wx.
You are right -- I just tested with the example below. We need to be very careful here and make sure we are getting the methods we want start_event_loop, draw_idle and friends) from the wx base class and not the base base class, and need to understand why it is working if it is (my guess is it is not but I haven't dived in yet). I think the only way to do this is to put the wx base class first and then make sure we override the print method in wxagg. My aversion to multiple inheritance grows by the day. class Base: def speak(self): print 'base' class Agg(Base): pass class Wx(Base): def speak(self): print 'wx' class WXAgg(Agg,Wx): pass wxagg = WXAgg() wxagg.speak() ------------------------------------------------------------------------- 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 Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel