Yep, I think this is exactly the problem (though I could
> never reproduce it), and, like you say, creating wxapp in
> new_figure_manager() sounds like the right solution to me.
> I think this was part of the discussion with Marcin W. a
> month ago, no?? Anyway, in backend_tkagg (the closest
> analogy I'm familar with), Tk.Tk() is created in
> new_figure_manager. It seems that with other windowing
> systems, it's ok to create the mainApp (ie, who will run the
> event loop) if needed in show()??? Perhaps it would make
> sense to have this be more uniform across the different
> 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