develooper Front page | perl.beginners | Postings from February 2002

TK::Text issue that I can;t figure out how to properly get formatted printout of...

From:
Chris
Date:
February 13, 2002 07:50
Subject:
TK::Text issue that I can;t figure out how to properly get formatted printout of...
Message ID:
3C6A8A5E.4000606@candp-ent.com
The following code works great to put the text onto the screen:

#***********************************************************
#*
#* Add the Summary Textbox
#*
#***********************************************************
my $t = $f->Text(
     -width  => 65,
     -height => 4,
     -wrap   => 'word'
)->pack(%packinfo, -pady => 5, -padx => 2);



And later, when I am writing it out, I get the data via:

     #***********************************************************
     #*
     #* Get the text from the Text box
     #*
     #***********************************************************
     my $text = $summaryT->get("1.0", "end");

     #***********************************************************
     #*
     #* Print the text from the Text box.
     #*
     #***********************************************************
     $text = wrap($spacing,$spacing, $text);


Thee problem is, I must hit the Enter key, in the Text box to actually 
have the output formatted with CrLfs, even though it is set to wrap.

This would normally be ok, but I am putting the text into an ascii file.
If I do not hit the Enter, inside the text box, it will all be on one line.

I am looking for a way that I do not have to hit Enter, inside the Text 
box in order for it to wrap inside the file, when I get it and print it out.

Any ideas?

TIA!




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About