in reply to Re: Tk::DirTree & Win
in thread Tk::DirTree & Win

correction: I override 'has_subdir' in Tk::DirTree package.
Also there is some more to override in those packages for Win32 (for case-insensistive sorting, for exampe):
package ::Tk::DirTree; sub has_subdir {1} sub DirCmd { my ($w, $dir, undef) = @_; $dir =~ s/^(\w:)$/$1\//; my $h = DirHandle->new($dir) or return; my @names = grep( $_ ne '.' && $_ ne '..', $h->read ); return @names; } sub add_to_tree { my( $w, $dir, $name, $parent ) = @_; my $image = $w->Getimage( $w->cget('-image') ); my $mode = 'none'; $mode = 'open' if $w->has_subdir( $dir ); my @args = (-image => $image, -text => $name); if( $parent ) { # Add in alphabetical order. foreach my $sib ($w->infoChildren( $parent )) { if( lc($sib) gt lc($dir) ) { push @args, (-before => $sib); last; } } } $w->add( $dir, @args ); $w->setmode( $dir, $mode ); }

Replies are listed 'Best First'.
Re: Re: Re: Tk::DirTree & Win
by NaSe77 (Monk) on May 30, 2002 at 11:12 UTC
    thanx i'll give it a shut

    ----
    NaSe
    :x