[plt-scheme] can't get caret-hiding working with selection

From: Martin DeMello (martindemello at gmail.com)
Date: Sun Apr 27 23:45:23 EDT 2008

I'm trying to define a read-only text% object in which text can be
selected, but the caret never be displayed. Is this possible? Here's
what I have so far - everything works, but the text can't be selected.

(define read-only-text%
  (class text%
    (init-field (insertable? #t))
    (augment can-insert? can-delete?)
    (define (can-insert? s l) insertable?)
    (define (can-delete? s l) #f)
    (define (caret-hidden?) #t)
    (define/public (set-insertable b) (set! insertable? b))
    (super-instantiate ())
    (send this hide-caret #t)
    ))


Posted on the users mailing list.