use warnings; use strict; use Tk; use Tk::Pane; my $top = MainWindow->new; my $pane = $top->Scrolled('Pane', -scrollbars => 'e', )->pack(-expand => 'y', -fill => 'both'); for (0 .. 9) { $pane->Button( -text => $_, -width => 15, -command => [sub{print "Button $_[0] Pressed\n"},$_], )->pack; } $top->Button( -text => 'Quit', -command => sub{$top->destroy}, )->pack; MainLoop;