use strict; use warnings; use Tk; #use Tk::Text; use Win32::GUI; use Term::ReadLine; #**************************** # Find Current Time #**************************** my @time        = localtime(); my $time_string = sprintf "%02d.%02d.%04d %02d:%02d.%02d",                $time[3], $time[4]+1, $time[5]+1900,                $time[2], $time[1], $time[0]; #**************************** # New Main Window #**************************** my $mw = MainWindow->new; $mw->geometry("670x400+41+66");     my $Message = "Pls. Enter Session Name (W12345)"; $mw->title("Host Terminal Emulator V.0.1, $time_string");     my $screen1 = $mw->Label(-text         => "$Message",                                           -background   => '#D4D0C8',                                           -font         => '{Arial} 11 {bold}')->pack;        $screen1->place      (-width        => 250,                                     -height       => 40,                                     -x            => 0,                                     -y            => 0); #**************************** # Session Input Filed #**************************** my $Session = $mw->Entry(-text         => my $PID,                                     -width        => 80,                                     -font         => '{Arial} 10 {bold}')                          ->pack (-expand       => 1,                                      -fill         => 'x',);              $Session->place(-width        => 70,                                     -height       => 30,                                     -x            => 250,                                     -y            => 5);             $Session->focus(); #**************************** # Command Window #**************************** my $scroll = $mw->Scrolled("Text",                                     -font       => '{Arial} 10 {bold}',                                    -scrollbars => 'e')                       ->pack;              $scroll->place(-width       => 575,                                  -height      => 350,                                  -x           => 5,                                  -y           => 45); #$scroll->bind('' => [$scroll, 'validate', Ev(['get'])]); $mw->bind ('', \&call2); #**************************** # Open Session to TIPFEO #**************************** my $TIPFEO = $mw->Button(-text        => "TIPFEO",                                       -font        => '{Arial} 10 {bold}',                                       -height      => 1,                                       -width       => 8,                                         -underline   => 4,                                       -anchor      => 'c',                                       -command     => \&call_term)                          ->pack  (-ipadx       => '45');                                       $TIPFEO->place (-x           => 430,                                         -y           => 5,);         MainLoop(); sub call_term{ my $str1 = "hallo du da"; $scroll->insert('end', "$str1"); my $str = $str1; &call2($str); } sub call2{ my $str1 = $scroll->get(); print $str1; }