perlquestion
mullr
Here's the scoop:<p>
Upon upgrading my system to Redhat 7.1 (and thus to perl
5.6), my pet program broke. I've isolated the problem, and
it lies it the <i>Scrolled</i> function. Here's an example
which should, as far as I can tell, work properly.
<code>
use strict;
use Tk;
my $mw = MainWindow->new( -title => 'Test' );
my $listbox = $mw->Scrolled( 'Listbox' );
my @list = ( qw ( foo bar baz batz dingo dongo dango
floo blar blaz blatz zingo zongo zango
fi ba be bz uno duo trio quitro ) );
for my $item (@list) {
$listbox->insert( 'end', $item );
}
$listbox->pack( -expand => 1, -fill => 'both' );
MainLoop;
</code>
This code is taken almost verbatim from a <a href="http://perlmonks.com/index.pl?node_id=54288">writeup</a>
by <a href="http://perlmonks.com/index.pl?node_id=45391">ichimunki</a>,
so I trust that it works. But on my system, it <a href="http://www.rpi.edu/~mullr/scrolled1.jpg">
doesn't</a>. <p>
I tried resizing the scrollbars to something more sensible
by adding the following code:
<code>
my $xsb = $listbox->Subwidget("xscrollbar");
my $ysb = $listbox->Subwidget("yscrollbar");
$xsb->configure(-width => 10);
$ysb->configure(-width => 10);
</code>
This half solves the problem, but still leaves pretty blatant
layout <a href="http://www.rpi.edu/~mullr/scrolled2.jpg">issues</a>. <p>
Any ideas? Has anybody seen this problem?