# Interactive Scribbling # # Use the left mouse button to draw, the right button to erase. link graphics procedure main() local x, y WOpen("size=400,300") | stop("*** cannot open window") repeat { case Event() of { &lpress: { DrawPoint(&x, &y) x := &x y := &y } &ldrag: { DrawLine(x, y, &x, &y) x := &x y := &y } &rpress | &rdrag: { EraseArea(&x - 2, &y - 2, 5, 5) } "q": exit() } } end