#!/usr/bin/perl use strict; use warnings; use Tk; use Tk::ROText; tk_start(); exit; sub tk_start { my $mw = new MainWindow; # # horizontale und vertikale Rollbalken: # my $rollx = $mw->Scrollbar( -orient => 'horizontal', )->pack( -side => 'bottom', -fill => 'x', ); my $rolly = $mw->Scrollbar( )->pack( -side => 'right', -fill => 'y', ); # # Textwidget: # my $text = $mw->ROText( -height => 10, -width => 50, -wrap => 'none', -xscrollcommand => ['set' => $rollx], -yscrollcommand => ['set' => $rolly], )->pack( -fill => 'both', -expand => 1, ); # # Die Rollbalken an das Textwidget binden: # $rollx->configure(-command => ['xview' => $text]); $rolly->configure(-command => ['yview' => $text]); # # Textwidget füllen # seek DATA, 0, 0; while () { $text->insert('end', $_); } MainLoop(); } # sub tk_start _ _DATA_ _