modular/gui/sexp-window.scm
(module sexp-window mzscheme

  (require (lib "pretty.ss")
           (lib "class.ss")
           (lib "mred.ss" "mred"))

  (provide sexp-window<%>
           sexp-window%)

  (define sexp-window<%>
    (interface (window<%>)
      get-sexp
      set-sexp))

  (define sexp-window%
    (class* vertical-panel% (sexp-window<%>)
      (super-new)

      (init sexp)
      (define the-sexp sexp)

      (define/public (get-sexp) the-sexp)
      (define/public (set-sexp v)
        (set! the-sexp v)
        (update-text))

      (define/private (update-text)
        (send the-message set-label
              (pretty-format the-sexp
                             (send the-slider get-value))))

      (define the-message
        (new message%
             [label ""]
             [parent this]
             [stretchable-width #t]
             [stretchable-height #t]))
      (define the-slider
        (new slider%
             [label "Wrap Width"]
             [min-value 1] [max-value 200]
             [init-value 80]
             [parent this]
             [callback (lambda _ (update-text))]))

      (update-text)

      ))

  )