in reply to Re: Re: Coloring text using TK?
in thread Coloring text using TK?
my @words = ("sub", "if", "elsif", "else", "my", "use"); foreach my $word (@words) { my $word_len = length $word; my $next = "1.0"; while (my $from = $t->search(-regexp, "\\b$word\\b", $n +ext, "end")) { $next = "$from + $word_len chars"; $t->tagAdd("blue", $from, $next); $t->tagAdd("bold", $from, $next); } }
|
|---|