in reply to Printing text from scrolled window?
Contents returns the contents of a Text widget as a string. \n is used to seperate lines so the following should get you what you want:
... $frame_2->Button( -text => 'Print', -width=>7, -command=>\&doPrint )->pack(-side =>'bottom'); MainLoop; sub doPrint { my @lines = split /\n/, $scroll->Contents (); print join "\n", @lines; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Printing text from scrolled window?
by Fletch (Bishop) on Jul 28, 2006 at 13:00 UTC | |
by GrandFather (Saint) on Jul 28, 2006 at 18:42 UTC | |
by Fletch (Bishop) on Jul 28, 2006 at 19:00 UTC | |
|
Re^2: Printing text from scrolled window?
by jdtoronto (Prior) on Jul 28, 2006 at 17:34 UTC | |
by GrandFather (Saint) on Jul 28, 2006 at 18:55 UTC | |
by Fletch (Bishop) on Jul 28, 2006 at 19:11 UTC |