Page 203 - Programming With Python 3
P. 203
An Introduction to STEM Programming with Python — 2019-09-03a Page 190
Chapter 19 — Better Graphics
graphwin.getMouse() Method of GraphWin
Free
Wait for the user to do a mouse click on the window and return the point where
they clicked.
graphwin.close() Method of GraphWin
eBook
Close the window and release all of its resources.
1| import graphics
2|
Edition
3| win = graphics.GraphWin("My Circle", 100, 100)
4|
5| c = graphics.Circle(graphics.Point(50,50), 10)
6| c.draw(win)
7|
8| print("Click on popup window to close program.")
Please support this work at
9| win.getMouse() # Pause to view result
10| win.close() # Close window when done
http://syw2l.org
Free
Illustration 29: A Circle Drawn with the Graphics Module
eBook
Shape Attributes
There are several attributes of shapes that you may manipulate. This allows you to draw exactly what
you want to. There are additional attributes, beyond those covered here. You will find details about
them in the documentation for the Graphics module.
Edition
graphicsobject.setWidth(width) Method of shape objects
Copyright 2019 — James M. Reneau Ph.D. — http://www.syw2l.org — This work is licensed
under a Creative Commons Attribution-ShareAlike 4.0 International License.

