-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Monday 14 July 2008 21:22:31 you wrote:
> >>> 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?
> >
> > Hi, Ryan,
> >
> > Thanks for your continued help.
> >
> > I am calling show() once, and closing the figure doesn't cause it to
> > return? I've verified the lack of return using debug sys.stderr.write()
> > statements, as well as by following show() with a sys.exit() command.
>
> (Getting this back on the full list...)
>
> This sounds like a bug to me, specific to your set up. I just ran a
> script (for my own sanity) and closing the figure, resulted in the
> script exiting and returning to the command prompt. Do you happen to
> have a small complete example that replicates your problems that you
> could post here?
>
> Also, what are your versions of matplotlib and PyGtk (you are using
> GtkAgg, right)? Also, what OS are you running?
>
> Devs, what do you think?
>
> Ryan
> --
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
Thanks, Ryan, The requested info is below.
Thanks again.
James
- ----- SMALL COMPLETE EXAMPLE CODE FOLLOWS -------------
#!/usr/bin/python
# File: test.py
import os,sys
import pylab as PL
import numpy as N
def main():
fig = PL.figure(1)
x = N.arange(120.0)*2*N.pi/120.0
x = PL.resize(x, (100,120))
y = N.arange(100.0)*2*N.pi/100.0
y = N.resize(y, (120,100))
y = N.transpose(y)
z = N.sin(x) + N.cos(y)
PL.imshow( z , cmap=PL.cm.jet)#, interpolation='nearest')
sys.stderr.write("Begun.")
PL.show()
sys.stderr.write("Done.")
sys.exit(0)
if __name__ == "__main__":
- ---- END OF SAMPLE CODE -------------------
Sample output:
- ------- BEGIN --------------
$ ./test.py
Begun.
- ------- COMMENTS: --------------
The image displays.
I click on the X; the image disappears.
Nothing happens in the terminal output.
In the terminal window I type <ctrl>C.
- ------- BEGIN --------------
^CTraceback (most recent call last):
File "./test.py", line 59, in <module>
main()
File "./test.py", line 25, in main
PL.show()
File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_gtk.py",
line 71, in show
gtk.main()
KeyboardInterrupt
$
- ------ END OF OUTPUT CODE ----------
The same behavior occurs when run from within an interactive session.
python version: 2.5.1 (4251:54863, Jun 15 2008, 23:59:20)
Matplotlib version: 0.91.2
PyGTK version: 2.12.0-2.fc8
In ~/.matplotlib/matplotlibrc: backend : GTKAgg
OS: Fedora 8
Linux kernel: 2.6.25.6-27.fc8
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQFIfKh4xOXthSHeGJIRAvbzAKCF9U7EJ4oM2JyQjKokOBZAv6PSlwCfZV3t
I5jSycQj8dAqI0QGkewAw3o=
=vdPu
-----END PGP SIGNATURE-----
-------------------------------------------------------------------------
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-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users