Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 103836
Status: patched
Priority: 0/
Queue: Tk

People
Owner: SREZIC [...] cpan.org
Requestors: ASB [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 804.033
Fixed in: (no value)



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
On 2015-04-20 10:37:15, ASB wrote: Show quoted text
> 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
I guess the documentation is inaccurate here. If I look at the source code, then -scrollbars => 'nw' is created by default. It seems that scrollbars may be removed by specifying -scrollbars => ''.
Am Di 21. Apr 2015, 15:56:32, SREZIC schrieb: Show quoted text
> On 2015-04-20 10:37:15, ASB wrote:
> > 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
> > I guess the documentation is inaccurate here. If I look at the source > code, then -scrollbars => 'nw' is created by default. It seems that > scrollbars may be removed by specifying -scrollbars => ''.
True, setting it to '' hides the scrollbars. I tested it but got an error, but I guess I did something else wrong. What would be your favorite pull request? A change in the documentation or a fix to the source code?
On 2015-04-24 04:52:46, ASB wrote: Show quoted text
> Am Di 21. Apr 2015, 15:56:32, SREZIC schrieb:
> > On 2015-04-20 10:37:15, ASB wrote:
> > > 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
> > > > I guess the documentation is inaccurate here. If I look at the source > > code, then -scrollbars => 'nw' is created by default. It seems that > > scrollbars may be removed by specifying -scrollbars => ''.
> > > True, setting it to '' hides the scrollbars. I tested it but got an > error, but I guess I did something else wrong. > > What would be your favorite pull request? A change in the > documentation or a fix to the source code?
I would like to keep the present behavior, people may depend on it. So a documentation change would be my favorite.
Am Fr 24. Apr 2015, 13:19:51, SREZIC schrieb: Show quoted text
> On 2015-04-24 04:52:46, ASB wrote:
> > Am Di 21. Apr 2015, 15:56:32, SREZIC schrieb:
> > > On 2015-04-20 10:37:15, ASB wrote:
> > > > 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
> > > > > > I guess the documentation is inaccurate here. If I look at the > > > source > > > code, then -scrollbars => 'nw' is created by default. It seems that > > > scrollbars may be removed by specifying -scrollbars => ''.
> > > > > > True, setting it to '' hides the scrollbars. I tested it but got an > > error, but I guess I did something else wrong. > > > > What would be your favorite pull request? A change in the > > documentation or a fix to the source code?
> > I would like to keep the present behavior, people may depend on it. So > a documentation change would be my favorite.
There is now a documentaion PR on GitHub: https://github.com/eserte/perl-tk/pull/18