Skip Menu |

This queue is for tickets about the Tk-Tree CPAN distribution.

Report information
The Basics
Id: 26238
Status: resolved
Priority: 0/
Queue: Tk-Tree

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

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



Subject: Tk::DirTree has a wrong ISA list
In Tk::DirTree, the use base line should be changed from use base qw(Tk::Widget Tk::Derived Tk::Tree); to use base qw(Tk::Derived Tk::Tree); otherwise things won't work (same change was needed for Tk::Tree some weeks ago). Also, make sure that $VERSION is changed, as the current Tk::DirTree version is the same as the version of the module in the Tk distribution, but both files are not the same, so must not have the same $VERSION. Maybe this also applies to Tk::Tree, but I did not check this. Regards, Slaven
Attached is a test file that you can use to check this. In its broken state, the test dies with Bad option `-directory' at c:/Perl/lib/Tk/Widget.pm line 205. If you fix DirTree.pm, you'll see the widget. -- - - Martin 'Kingpin' Thurn
use ExtUtils::testlib; use Test::More 'no_plan'; use Tk; BEGIN { use_ok('Tk::DirTree'); } # end of BEGIN block my $mw = new MainWindow; isa_ok($mw, 'MainWindow'); $mw->Button( -text => 'exit', -command => sub { pass('use clicked exit'); exit; }, )->pack(qw( -side bottom -pady 6 )); my $f = $mw->Scrolled('DirTree', -width => 55, -height => 33, -directory => 'C:/', )->pack(qw( -fill both -expand 1 )); pass('after create, with -directory option'); my $tree = $f->Subwidget(); isa_ok($tree, 'Tk::DirTree'); $mw->update; $mw->after( 500, sub { pass('Tk::After'); exit }, ); pass('before MainLoop'); MainLoop; pass('after MainLoop'); __END__
This is resolved in Tk-Tree-4.71 and was never a problem in the Tk::DirTree version which lived in the core Tk distribution. A tweaked version of the test script will also be in the Tk distribution. Regards, Slaven