Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 52609
Status: open
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: slemmen [...] ehbmail.com
Cc:
AdminCc:

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



Subject: Bug or poor documentation in Tk-NoteBook 4.011
Date: Wed, 09 Dec 2009 11:05:43 -0500
To: bug-Tk [...] rt.cpan.org
From: Stuart Lemmen <slemmen [...] ehbmail.com>
Hi, First some background: Distribution name and version: Tk-NoteBook 4.011 Perl version: This is perl, v5.8.8 built for MSWin32-x86-multi-thread (actually ActiveState Perl 5.8.8 for Win32) Operating System vendor and version: Windows XP Pro ver. 5.1 Service Pack 3 In the documentation for Tk-NoteBook it is stated, "The widget takes all the options that a Frame does.". However this does not appear to be the case. Case in point, instantiating a new NoteBook and including size options fails: my $Mw = MainWindow->new(-title => $0); my $Notebook = $Mw->NoteBook(-width => 500, -height => 500)->place(-x => 1, -y => 1); Gives: Tk::Error: Can't set -height to `500' for Tk::NoteBook=HASH(0x3cedd08): Bad option `-height' at C:/perl/site/lib/Tk/Configure.pm line 46. at C:/perl/site/lib/Tk/Derived.pm line 294 Tk callback for event Tk callback for . Tk callback for .notebook Tk::Derived::configure at C:/perl/site/lib/Tk/Derived.pm line 306 Tk::Widget::new at C:/perl/site/lib/Tk/Widget.pm line 205 Tk::Widget::__ANON__ at C:/perl/site/lib/Tk/Widget.pm line 256 Can't set -height to `500' for Tk::NoteBook=HASH(0x3cedd08): Bad option `-height' at C:/perl/site/lib/Tk/Configure.pm line 46. at C:/perl/site/lib/Tk/Derived.pm line 294 at C:/perl/site/lib/Tk/Derived.pm line 306 It is also not possible to instantiate a tab with said options: my $Tab_1 = $Notebook->add('tab_1', -width => 500, -height => 500, -label => 'Tab No. 1', -state => 'normal'); Gives: Bad option `-height' at C:/perl/site/lib/Tk.pm line 250. However, it is possible to configure the size on the tab object reference: $Tab_1->configure(-width => 500, -height => 500); Works just fine. Finally, this post 'configure' does not also work for the NoteBook reference: my $Mw = MainWindow->new(-title => $0); my $Notebook = $Mw->NoteBook()->place(-x => 1, -y => 1); $Notebook->configure(-width => 500, -height => 500); Gives: Tk::Error: Can't set -height to `500' for Tk::NoteBook=HASH(0x3cec578): Bad option `-height' at C:/perl/site/lib/Tk/Configure.pm line 46. at C:/perl/site/lib/Tk/Derived.pm line 294 Tk callback for event Tk callback for . Tk callback for .notebook Tk::Derived::configure at C:/perl/site/lib/Tk/Derived.pm line 306 Can't set -height to `500' for Tk::NoteBook=HASH(0x3cec578): Bad option `-height' at C:/perl/site/lib/Tk/Configure.pm line 46. at C:/perl/site/lib/Tk/Derived.pm line 294 If this post-configuration is the way NoteBook tabs are meant to work then it seems poorly documented. -Stuart Lemmen
On Wed Dec 09 11:02:33 2009, slemmen@ehbmail.com wrote: Show quoted text
> Hi, > > First some background: > > Distribution name and version: Tk-NoteBook 4.011 > > Perl version: This is perl, v5.8.8 built for MSWin32-x86-multi-thread > (actually ActiveState Perl 5.8.8 for Win32) > > Operating System vendor and version: Windows XP Pro ver. 5.1 Service
Pack 3 Show quoted text
> > > In the documentation for Tk-NoteBook it is stated, "The widget takes all > the options that a Frame does.". However this does not appear to be the > case. Case in point, instantiating a new NoteBook and including size > options fails: > > my $Mw = MainWindow->new(-title => $0); > my $Notebook = $Mw->NoteBook(-width => 500, -height => 500)->place(-x => > 1, -y => 1); > > Gives: > > Tk::Error: Can't set -height to `500' for Tk::NoteBook=HASH(0x3cedd08): > Bad option `-height' at C:/perl/site/lib/Tk/Configure.pm line 46. > at C:/perl/site/lib/Tk/Derived.pm line 294 > Tk callback for event > Tk callback for . > Tk callback for .notebook > Tk::Derived::configure at C:/perl/site/lib/Tk/Derived.pm line 306 > Tk::Widget::new at C:/perl/site/lib/Tk/Widget.pm line 205 > Tk::Widget::__ANON__ at C:/perl/site/lib/Tk/Widget.pm line 256 > Can't set -height to `500' for Tk::NoteBook=HASH(0x3cedd08): Bad option > `-height' at C:/perl/site/lib/Tk/Configure.pm line 46. > at C:/perl/site/lib/Tk/Derived.pm line 294 > at C:/perl/site/lib/Tk/Derived.pm line 306 > > It is also not possible to instantiate a tab with said options: > > my $Tab_1 = $Notebook->add('tab_1', -width => 500, -height => 500, > -label => 'Tab No. 1', -state => 'normal'); > > Gives: > > Bad option `-height' at C:/perl/site/lib/Tk.pm line 250. > > However, it is possible to configure the size on the tab object reference: > > $Tab_1->configure(-width => 500, -height => 500); > > Works just fine. > > Finally, this post 'configure' does not also work for the NoteBook > reference: > > my $Mw = MainWindow->new(-title => $0); > my $Notebook = $Mw->NoteBook()->place(-x => 1, -y => 1); > $Notebook->configure(-width => 500, -height => 500); > > Gives: > > Tk::Error: Can't set -height to `500' for Tk::NoteBook=HASH(0x3cec578): > Bad option `-height' at C:/perl/site/lib/Tk/Configure.pm line 46. > at C:/perl/site/lib/Tk/Derived.pm line 294 > Tk callback for event > Tk callback for . > Tk callback for .notebook > Tk::Derived::configure at C:/perl/site/lib/Tk/Derived.pm line 306 > Can't set -height to `500' for Tk::NoteBook=HASH(0x3cec578): Bad option > `-height' at C:/perl/site/lib/Tk/Configure.pm line 46. > at C:/perl/site/lib/Tk/Derived.pm line 294 > > If this post-configuration is the way NoteBook tabs are meant to work > then it seems poorly documented. > > -Stuart Lemmen
Confirmed. I have added now a "bugs" sections in the NoteBook documentation. Fixing the issue seems to be difficult. Probably the best workaround is to set the geometry of the notebook widget using -width and -height on one of the frame widgets created by the add() method. Regards, Slaven