use Tk; $mw = MainWindow->new(); $frame = $mw->Frame(); $scrollx = $frame->Scrollbar(-orient => 'horizontal'); $scrolly = $frame->Scrollbar(); $text = $frame->Text(-xscrollcommand => ['set' => $scrollx], -yscrollcommand => ['set' => $scrolly]); $scrollx->configure(-command => ['xview' => $text]); $scrolly->configure(-command => ['yview' => $text]); $scrollx->pack(-side => 'bottom', -fill => 'x'); $scrolly->pack(-side => 'right', -fill => 'y'); $text->pack(-side => 'top', -expand => 1, -fill => 'both'); MainLoop;