See [Ctext] highlighting widget for a complete solution that works well. ---- Also see [Jeffrey Hobbs] ''Tcl source code to HTML compatible format converter [http://www.tcl.tk/community/hobbs/tcl/script/main.html]''. Does some intelligent highlighting. ---- See also [Looping over the contents of a text widget] which includes code that lets you supply a pattern and apply a tag to all ranges that match that pattern. ---- !!!!!! %| [Category GUI]|[Category syntax] |% !!!!!!