[plt-scheme] Text field font troubles

From: Sky O'Mara (skyo at ccs.neu.edu)
Date: Sat Aug 9 23:19:26 EDT 2008

You're right, thanks for that tip!

I agree that snips are pretty confusing. It would be nice to see some  
examples of how to use them properly.

- Sky O.

On Aug 9, 2008, at 9:37 PM, praimon wrote:

> 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.
>>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.