[plt-scheme] Re: What to augment, how to highlight ?

From: Laurent (Ouaibou at gmail.com)
Date: Thu Nov 22 18:07:02 EST 2007

I have finally used the color:text% width the start-colorer method.

The start-colorer method needs 3 params. I can use how that :

(send this start-colorer (lambda (s) (format "framework:syntax-
color:scheme:~a" style)) get-word `()))

Where style is as defined scheme code style like 'keyword,
constant, ...'.
However, if i want to use my own style, i must to add style in the
current text% which inherits from color:text%, like this :

...
(let* ((sl (send this get-style-list))
       (bs (send sl basic-style))
       (delta (make-object style-delta%)))
  (send delta set-delta-foreground (make-object color% "red"))
  (send delta get-underlined-on)
  (send sl new-named-style "keyword" bs)
  (send sl find-or-create-style (send sl find-named-style "keyword")
delta)
  (send this set-style-list sl))
...

(send this start-colorer (lambda (s) "keyword") get-word `()))

My problem is the lambda return value. If i use "keyword" i have no
error but my text is not colored with the new style.
Which is the string i must to return in the lambda ?

Thanks,

Kind Regards,

Laurent


Posted on the users mailing list.