Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Line size in a text widget

by Daruma (Curate)
on Mar 10, 2004 at 04:43 UTC ( #335347=note: print w/ replies, xml ) Need Help??


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


Comment on Re: Line size in a text widget
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. } }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://335347]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2015-07-29 10:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls