drawUndo(toPosn: Integer);
The drawUndo method of the Window class rolls the graphics history back to a previous point in the image construction and removes the history past the indicated point. A repaint is then caused to draw the image as it was at that point. The toPosn parameter is the last graphics command to be retained.
If the setting of the autoRedraw property is false or if there is no history, this method has no effect. After the command has completed, the image is painted at the indicated history point. The graphical attributes are also reset to the values as at that point.
The drawUndo(0); method does the same as clearGraphics method, except that the undo restores the drawing attributes back to what they were at the start of the history recording process, while the clearGraphics method retains the current values.
The size of the draw history can be determined at any point, by using the drawSize method.