http://www.perlmonks.org?node_id=335344

witandhumor has asked for the wisdom of the Perl Monks concerning the following question:

I have a simple issue that I need some help with. Can someone give me a nudge in the right direction?

I am trying to define how many characters can be in a line in a Text Widget. I only want 30 characters on each line.

I do not have a piece of code that even comes close...I have looked and tried Tags and defining -rmargin, but that doesn't seem to do it....help!

#!c:\perl\bin\perl.exe -w use Tk; my $char= "&"; my $mw=MainWindow->new; my $t=$mw->Scrolled("Text",-height=>'45',-width=>'80')->pack(); $t->tagConfigure('tag',-font => "Courier 24 bold",-rmargin=>50); my $tm=500; my $try=Tk::After->new($mw,$tm,'repeat',\&loop); stop(); MainLoop; sub stop { $t->delete('1.0','end'); foreach (1..500) { $t->insert('1.0', ' '); } } sub loop { $num++; if($num==1){first(); } if($num == 3){ second(); } if($num == 4){ third(); } if($num == 5){stop(); $num=0;} } sub first { $t->insert('1.5',$char,'tag'); } sub second { $t->insert('3.6',$char); } sub third { $t->insert('3.7',$char); }

Thanks in advance,

witandhumor