CC: | RobSeegel [...] comcast.net |
Subject: | Tk::MListbox and Config::Std (CODE reference at ...) |
Date: | Thu, 12 Mar 2009 20:37:42 +0000 (GMT) |
To: | bug-Tk-MListbox [...] rt.cpan.org |
From: | djibrilo <djibrilo [...] yahoo.fr> |
Dear,
I have try to use Tk::MListbox and it's work fine.
Nevertheless, there is a bug when I use this module in a script which use Config::Std (by use or require).
The error message is : Not a CODE reference at C:/Perl/site/lib/Tk/MListbox.pm line 703.
My configuration :
ActivePerl 5.8.8 Build 822
Tk : Tk-804.028
Tk-MListbox-1.11
OS : WinXP
Example :
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
use Tk::MListbox;
use Config::Std;
my $mw = MainWindow->new;
$mw->title('Simple MListbox');
my $Frame2 = $mw->Frame(
-background => "red",
)->pack( qw/ -fill both -expand 1/ );
my $ml = $Frame2->Scrolled('MListbox',
-scrollbars => 'osoe',
-background => 'white',
-foreground => 'blue',
-textwidth => 10,
-highlightthickness => 2,
-width => 0,
-selectmode => 'browse',
-bd=>2,
-relief=>'sunken',
-separatorwidth => 0,
-columns=>[
[qw/-text Mode -textwidth 10 /],
[qw/-text NLink -textwidth 5/, -comparecmd => sub {$_[0] <=> $_[1]}],
[qw/-text UID/, ],
[qw/-text GID/, ],
[qw/-text Size/, -comparecmd => sub {$_[0] <=> $_[1]}],
[qw/-text Mtime/, -comparecmd => \&compareDate],
[qw/-text Name/, ],
[qw/-text Djibril/, ],
],
-separatorcolor => "red",
)->pack(-expand=>1, -fill=>'both', -anchor=>'w');
$ml->insert('end', [1..5] );
$ml->insert('end', [10,9,8,7,6,5,4] );
MainLoop;
============================================================
Tk::Error: Not a CODE reference at C:/Perl/site/lib/Tk/MListbox.pm line 703.
Tk::Widget::Callback at C:/Perl/site/lib/Tk/Widget.pm line 1149
Tk::CListbox::yview at C:/Perl/site/lib/Tk/MListbox.pm line 63
Tk::Derived::Delegate at C:/Perl/site/lib/Tk/Derived.pm line 463
Tk::Widget::__ANON__ at C:/Perl/site/lib/Tk/Widget.pm line 322
Tk::MListbox::_yscrollCallback at C:/Perl/site/lib/Tk/MListbox.pm line 737
<Configure>
(command bound to event)
error:Not a CODE reference at C:/Perl/site/lib/Tk/MListbox.pm line 703.
============================================================
Best Regards,
Djibril