use strict; use warnings; use Tk qw(MainLoop); my $mw = MainWindow->new(-title => " Listbox Height-Change Test"); my $myFont = "{Lucida Fax} 12 bold"; my ($lb, $lbw); $mw->Button(-text => 'Print Height', -font => $myFont, -command => sub { print "HEIGHT: ", $lb->cget(-height), "\n"; }, )->pack(); $mw->Button(-text => 'Change Height', -font => $myFont, -command => sub { $lb->configure(-height=>5); }, )->pack(); my @items = ("thing1", "THing2", "THING3"); $lb = $mw->Scrolled('Listbox', -font => $myFont, -background => 'darkblue', -foreground => 'white', -scrollbars => 'osoe', -height => 15, -width => 28, -borderwidth => 1, -relief => 'solid', )->pack(); # $lbw = $lb->Subwidget('listbox'); $lb->delete(0,'end'); my $num = 0; $lb->insert('end', sprintf("%3d. $_\n", ++$num)) for (@items); MainLoop();