On 6/8/07, John Hunter <[EMAIL PROTECTED]> wrote: > It made me realize that despite all my protestations not to repeatedly > call show, we do not have a backend dependent way to raise new figures > created in mpl callbacks. Since we've mostly made show bullet-proof > to repeated calls (because we don't restart the mainloops) this works, > but we do need a backend independent way to raise figures.
I just made a minor modification to the backends (GTK, QT, QT4, Tk, and WX) in the figure managers to attach a show method to the figure class. It's not terribly elegant (and using this approach means it will not show up properly in the class documentation) but it works. If someone has a better, more elegant approach, I'm all for it, but at least now you can do fig.show() in pylab and it will do all the necessary GUI calls to raise the window. I've tested on GTK* and TkAgg -- those of you with svn access and WX* or QT* should test examples/pick_event_demo2.py on those platforms. The downside of this approach is that it makes porting pylab code to embedded GUI code a little harder, but such is the price of convenience. JDH ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
