[plt-scheme] [Mred] - syntax coloring in editor canvas

From: Robby Findler (robby at cs.uchicago.edu)
Date: Fri Dec 8 08:54:44 EST 2006

At Fri, 08 Dec 2006 13:33:18 +0100, "jack jack" wrote:
> >>i saw methods which changes colors but wasn't able to make them  work at 
> >>all, because the way i meant it is: using regexp-match to  look for the 
> >>keyword each time the user type text into the edit  canvas (when i get an 
> >>on-char event i call for the coloring  function, on the line or the entire 
> >>editor canvas content)
> >
> >You probably want after-insert and after-delete, rather than on-char.
> would you mind explaining me the proper way to use after-insert and 
> after-delete to detect user changes into the editor-canvas : do i need to 
> redefine a personalized editor text which class is editor-canvas%, then 
> define/augment the after-insert & after-delete methods?

Almost: you want a new text% class, not editor-canvas%. From there you
augment the after-insert and after-delete methods.


Posted on the users mailing list.