use strict; use Tk; my $mw = MainWindow->new(); # Create the vertical Scrollbar my $scrollbar = $mw->Scrollbar(); my $lb = $mw->Listbox(-yscrollcommand => ['set' => $scrollbar]); # Configure the Scrollbar to talk to the Listbox widget $scrollbar->configure(-command => ['yview' => $lb]); # Pack the Scrollbar first so that it doesn't disappear when we resize $scrollbar->pack(-side => 'right', -fill => 'y'); $lb->pack(-side => 'left', -fill => 'both'); my %cb; foreach ( qw/a b c d e f g h/ ) { $lb->Checkbutton(-text => "$_", -variable => \$cb{"cb$_"}) -> pack(-side => 'top'); } MainLoop();