previous up next     contents index
Next: A More Complicated Example Up: Graphics Previous: Flip Commands

A Basic Example

Type the following commands into the scheme interpreter.

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

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

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

  > (close-viewport w)                         ; viewport disappears

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



PLT