in reply to Line size in a text widget

Greetings, witandhumor!

I'm having a hard time visualizing what you are trying to do here.

Is this to be a text box where the text wraps to the next line at 30 characters?

or

Is this to be a text box that limits the information to 30 characters?

Daruma

Replies are listed 'Best First'.
Re: Re: Line size in a text widget
by witandhumor (Pilgrim) on Mar 10, 2004 at 04:46 UTC
    I should have clarified...sorry about that. This is a text box where the text wraps to the next line at 30 characters.
      not tested, just an idea...
      use Text::Autoformat; my ($allTheText) = shift; ## all your text to format my (@lins); ## your resulting lines my ($widthTxt) = 30; ## your line width... { my ($formated)=autoformat($allTheText, { left=>5, right=>$widthTxt +, all=>1}) if ($allTheText); foreach (split(/\n+/,$formated)) { push(@lins,$_); ## array w/lines of max.30chrs.wth. } }