From: John H. <jdh...@ac...> - 2005-04-11 15:25:35
|
>>>>> "Matt" == Matt Newville <new...@ca...> writes: Matt> Yep, I think this is exactly the problem (though I could Matt> never reproduce it), and, like you say, creating wxapp in Matt> new_figure_manager() sounds like the right solution to me. Matt> I think this was part of the discussion with Marcin W. a Matt> month ago, no?? Anyway, in backend_tkagg (the closest Matt> analogy I'm familar with), Tk.Tk() is created in Matt> new_figure_manager. It seems that with other windowing Matt> systems, it's ok to create the mainApp (ie, who will run the Matt> event loop) if needed in show()??? Perhaps it would make Matt> sense to have this be more uniform across the different Matt> backends? I just committed the changes to CVS, and I'm going to attach them here. Because I find these kinds of things sensitive to platform and version, ex users should test these with wx and wxagg for both pylab and the embedding_in_wx*.py examples and let me know if there are any troubles. As for making this more uniform, I'm inclined to leave this it up to the various backends to handle gui instantiation in the way that they see fit. I don't know enough about the various GUIs (and potential GUIs we haven't encountered yet) to enforce a single policy. I did add some guidance in the backend_template.py new_figure_manager function along these lines # if a main-level app must be created, this is the usual place to # do it -- see backend_wx, backend_wxagg and backend_tkagg for # examples. Not all GUIs require explicit instantiation of a # main-level app (egg backend_gtk, backend_gtkagg) for pylab Does this look helpful? JDH |