[plt-scheme] Text field font troubles
Thanks,
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.
regards,
praimon
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.
>