in reply to Re: Perl Tk Text widget question
in thread Perl Tk Text widget question
Got a better way to do the above?Because I don't like the idea of having to search the text.Moreover the coloursub replace1{ my $chosen1=$opt1; $t->insert('sel.first',"$chosen1"); $t->delete('sel.first','sel.last'); $t->tagConfigure("replaced",-foreground=>"black"); my $r1=$t->search(-forwards,"$chosen1",'end'); $t->tagAdd("replaced","$r1","$r1 wordend"); #print"\nThe start pos of the pattern:"; #print "\n$result"; }
|
|---|