"Racket"が赤で表示され、"world"にはアンダーラインが引かれます。
#lang racket
(require racket/gui/base)
(define frame
(new frame%
[label "Example"]
[width 300]
[height 300]))
(define ecanvas
(new editor-canvas% [parent frame]))
(define txt-hello (new text%))
(send txt-hello insert "hello ")
(send txt-hello change-style
(send (make-object style-delta%)
set-delta-foreground "red"))
(send txt-hello insert "Racket ")
(send txt-hello change-style
(send (make-object style-delta%)
set-delta 'change-underline #t))
(send txt-hello insert "world")
(send ecanvas set-editor txt-hello)
(send frame show #t)