James K. Gruetzner wrote: > I don't really need any live interaction or a live data display; I just want > the thang to stop running (i.e., the process to terminate) when the figure > window is closed. > > Unfortunately, the > dynamic_image_gtkagg.py > example has the same problem. It's final line is "show()". When run as a > background process, everything displays well --- but when the window is > closed (click on X), the process fails to terminate. So . . . the root > cause is that show() does not return when the shown image is closed. > >> If you *need* it to wait for user interaction before continuing, there might >> be a little bit more work, but I don't think it'd be much. You could >> probably instead look at some of the Matplotlib UI widgets, like in the >> buttons.py example. > > I really don't need user interaction per se, I may have to go that route an > establish some sort of "close window and exit" event. Hmmm: another > learning opportunity . . . . :-) > > The show() function is defined in > .../matplotlib/backends/backend_gtk.py > and looks to be calling gtk.main(), which, according to > .../gtk-2.0/gtk/__init__.py > appears to be deprecated in favor of mainloop(). > > And that's as far as I can go in this: I'm not graphics whiz, and, in fact, > having reached somewhat beyond my skill level, can't even figure out how to > trace the mainloop call back further. > > I would think that the gtk mainloop would terminate when the window closes > (which termination should propagate back up the stack), but apparently that > doesn't happen.
I'm not sure I'm following you at the moment. Are you calling show() once and closing the figure doesn't cause it to return? or are you trying to call show() multiple times from a single script and subsequent calls to show() fail to return? Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users