I have written the following:
#!/usr/bin/perl -w
use strict;
use Tk;
my $maincolor='red';
my $mw = MainWindow->new;
$mw->minsize(qw(250 200)); #x y
$mw->configure(-title=>'PROGRAM', -background=>$maincolor);
my $frame_1=$mw->Frame(-borderwidth => 3, -background => $maincolor)->
+pack( -side=>'top', -fill=>'x');
$frame_1->Label(-text => 'Scroll', -background=>'yellow',)->pack(-side
+ =>'left');
my $scroll=$mw->Scrolled("Text", -scrollbars => 'e', -width => 10, -he
+ight => 10,)->pack;
my $frame_2=$mw->Frame(-borderwidth => 3, -background => $maincolor)->
+pack( -side=>'top', -fill=>'x');
$frame_2->Button(-text => 'Print', -width=>7, -command=>sub{})->pack(-
+side =>'bottom');
MainLoop;
The point is that there should be a scrolled window in which it is possible to directly write things. In my code the window it is of "Text"-type (but I´m not sure if others could be better). Now I would like to make it possible to print the text entered in the scolled window by clicking the "print" button, but I dont know how to do this, could you help me? Preferably (if it is possible) the text could be extracted as an array so that each line in the scrolled window is an ellement in the array.
Thank you for any help