[previous] [up] [next]     [contents] [index]
Next: A More Complicated Example Up: Graphics Previous: Miscellaneous Operations

A Basic Example

Type the following commands in DrScheme.

     ; nothing appears to happen
     ; but behind the scenes ...
  > (open-graphics)

     ; viewport appears
  > (define w (open-viewport "practice" 300 300))

     ; line appears
  > ((draw-line w) (make-posn 30 30) (make-posn 100 100))     

     ; viewport disappears
  > (close-viewport w)

     ; again, nothing appears to happen
     ; unclosed viewports (if any) would disappear
  > (close-graphics)



PLT