[plt-scheme] editor object.

From: Robert Bruce Findler (robby at cs.uchicago.edu)
Date: Tue Jan 14 11:34:02 EST 2003

I think that you wanted after-insert, not on-insert. on-insert is
called before the insertion actually takes place, so the characters
aren't yet in the editor.

Try this:

(define my-text%
  (class text%
    (inherit last-position get-text)
    (define/override after-insert
      (lambda (start len)
        (printf "~a" (get-text start (+ start len)))))
    (super-instantiate ())))


Posted on the users mailing list.