A GraphWin object represents a window on the screen where
graphical images may be drawn. A program may define any number of
GraphWins. A GraphWin understands the following methods:
- GraphWin(title, width, height)
- Constructs a new graphics
window for drawing on the screen. The parameters are optional, the
default title is ``Graphics Window,'' and the default size is 200
- plot(x, y, color)
- Draws the pixel at
in the window. Color is optional, black is the default.
- plotPixel(x, y, Color)
- Draws the
pixel at the ``raw'' position ignoring any coordinate
transformations set up by setCoords.
- Sets the window background to the given
color. The initial background is gray. See Section 5.8.5 for
information on specifying colors.
- Closes the on-screen window.
- Pauses for the user to
click a mouse in the window and returns where the mouse was
clicked as a Point object.
- Similar to
getMouse, but does not pause for a user click. Returns
the latest point where the mouse was clicked or None if
the window as not been clicked since the previous call to
checkMouse or getMouse. This is particularly
useful for controlling simple animation loops.
- setCoords(xll, yll, xur, yur)
the coordinate system of the window. The lower-left corner is
and the upper-right corner is . All
subsequent drawing will be done with respect to the altered
coordinate system (except for plotPixel).