Subject: | Tk::Table creates scrollbars even if scrollbar option is omitted |
Perl: 5.18.4
Tk: 804.033
The following script creates a scrollbar for Tk::Table although I did not specify the -scrollbars option.
According to the documentation, Tk::Table will only create scrollbars when the -scrollbars option is specified.
#!perl
use strict;
use warnings;
use Tk;
use Tk::Canvas;
use Tk::Table;
my $mw = tkinit();
my $canvas = $mw->Canvas(-bg => 'white',)->pack(-fill => 'both');
my $minmaxavg_tbl = $mw->Table(
-columns => 3,
-rows => 2,
-fixedrows => 1,
-relief => 'raised',
);
$minmaxavg_tbl->put(0,0, header_label($minmaxavg_tbl, 'min'));
$minmaxavg_tbl->put(0,1, header_label($minmaxavg_tbl, 'max'));
$minmaxavg_tbl->put(0,2, header_label($minmaxavg_tbl, 'avg'));
$canvas->createWindow(100, 100, -window => $minmaxavg_tbl);
$mw->MainLoop;
exit(0);
=head2 header_label( $text )
Erzeugt ein Label für die Titelzeile.
=cut
sub header_label {
my $table = shift or die('Missing Tk::Table');
my $text = shift // die('Missing header label text');
my $tmp = $table->Label(
-text => $text,
-relief => 'raised',
);
return $tmp;
} # /header_label