Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Re: Re: Line size in a text widget

by witandhumor (Pilgrim)
on Mar 10, 2004 at 04:46 UTC ( #335349=note: print w/replies, xml ) Need Help??

in reply to Re: Line size in a text widget
in thread Line size in a text widget

I should have clarified...sorry about that. This is a text box where the text wraps to the next line at 30 characters.

Replies are listed 'Best First'.
Re: Re: Re: Line size in a text widget
by chanio (Priest) on Mar 10, 2004 at 14:41 UTC
    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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://335349]
[virtualsue]: I have a quiet Perl themed slack workspace
[virtualsue]: The person who talks to me on it the most *hates* Perl but she hates everything
[virtualsue]: If anyone is interested, ping me an email address for an invitation.
[virtualsue]: I welcome any talktaive people who do not mind using a propietary walled-garden service for free
[virtualsue]: or even proprietary
[virtualsue]: we talk about programming and music and stuff
herveus waves to virtualsue

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (13)
As of 2017-09-26 14:00 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (295 votes). Check out past polls.