Can anyone help me with this? I'm planning to use the graphics module created by Zelle in a short programming unit in my IT class. I'm running Python 2.2.2 on Windows XP. Using IDLE, I have no problem creating 'graphics' windows and I can do lots of fun stuff in them. However, when I close any graphics window by clicking the close box everything terminates (IDLE and any other graphics windows that may have been open). Thanks, Brian
Brian, I had to do some tweaking of this code to make it work a little better with Python 2.3 and IDLE 1.0 on Windows, and the result is this annoying behavior you mention with your slightly older setup. When I have some time, I need to really sort through the issues here rather than applying band-aids. In any case, I think there is a simple fix for your situation. Take a look in the graphics.py file and locate the GraphWin class (it's the first one). The close method looks like this: def close(self): """Close the window""" self.master.destroy() self.quit() _root.update() Simply comment out the second line, "self.quit()", (i.e. put a pound sign in front of it). I think this will fix your problem. Please give it a try and let me know if it works; I don't have a setup for testing your version here. --John Brian Taylor wrote:
Can anyone help me with this?
I'm planning to use the graphics module created by Zelle in a short programming unit in my IT class. I'm running Python 2.2.2 on Windows XP. Using IDLE, I have no problem creating 'graphics' windows and I can do lots of fun stuff in them. However, when I close any graphics window by clicking the close box everything terminates (IDLE and any other graphics windows that may have been open).
Thanks,
Brian
------------------------------------------------------------------------
_______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
-- John M. Zelle, Ph.D. | Wartburg College Associate Prof. of CS | Dept. Math/CS/Physics john.zelle@wartburg.edu | Waverly, Iowa
participants (2)
-
Brian Taylor
-
John Zelle