use strict; use warnings; use Tk; use Win32::Clipboard; my $CLIP = Win32::Clipboard(); # Erzeugt das Mainwindow my $mw = MainWindow->new(); #Setzen der Fenstergröße my $windowHeight = "640"; my $windowWidth = "500"; #Auslesen der Bildschirmgröße my $screenHeight = $mw->screenheight; my $screenWidth = $mw->screenwidth; #Positionieren des Fensters auf dem Bildschirm $mw->geometry($windowWidth."x".$windowHeight); $mw->geometry("+".int($screenWidth/2 - $windowWidth/2)."+".(int($screenHeight/2 - $windowHeight/2)-40)); my $textWidget = $mw->Scrolled( 'Text', -scrollbars=>'se', #this can be n,s,e,w according to compass positions. -wrap => 'none', -font => '{Arial} 10' )->pack(-fill => 'both', -expand => 1); $textWidget->bind('', sub{ $textWidget->selectAll; }); $mw->protocol("WM_DELETE_WINDOW" => sub { $CLIP->Set($CLIP->Get()); exit; }); MainLoop;