[plt-scheme] Text field font troubles

From: praimon (praimon at gmail.com)
Date: Sat Aug 9 21:37:44 EDT 2008

It was helpful to see positions used here.
(btw, I think your final (send ed last-position) can be replaced with 'end).
But...you too abandoned snips! I wonder what a snip-based version
would look like.

On Sat, Aug 9, 2008 at 3:07 PM, Sky O'Mara <skyo at ccs.neu.edu> wrote:
> This is what I came up with to make use of change-style:
> (define (insert-red-text str ed)
>  (let ([red-delta (send (make-object style-delta%) set-delta-foreground
> "Red")]
>        [end-before (send ed last-position)]) ;; the end of the text before
> inserting str
>    (send ed insert str end-before)
>    (send ed change-style red-delta end-before (send ed last-position))))
> I hope this is a useful example. I agree that the documentation for the gui
> leaves much to be desired.
> - Sky O.

Posted on the users mailing list.