in reply to Tk::getOpenFile & select error

There is a typo in Tk::FBox.pm. In line 909 _get_select_Path should be all lowercased. If you avoid the -multiple option, this should not show up.

--- C:\strawberry-perl\perl\site\lib\Tk\FBox.pm Sa Feb 10 11:29:00 +2007 +++ C:\strawberry-perl\perl\site\lib\Tk\FBox-new.pm So Sep 6 11:39 +:02 2009 @@ -906,7 +906,7 @@ if ($w->cget('-multiple')) { $selectFilePath = []; for my $f (@{ $w->{'selectFile'} }) { - push @$selectFilePath, JoinFile($w->_get_select_Path, $f); + push @$selectFilePath, JoinFile($w->_get_select_path, $f); } } else { $selectFilePath = JoinFile($w->_get_select_path,

Cheers, Christoph

Replies are listed 'Best First'.
Re^2: Tk::getOpenFile & select error
by lamprecht (Friar) on Sep 06, 2009 at 09:50 UTC

    Just checked: This has been fixed in Tk-804.028_501 already.


    Cheers, Christoph
Re^2: Tk::getOpenFile & select error
by jcook4615 (Initiate) on Sep 06, 2009 at 21:24 UTC
    Chris,

    Thanks for the response regarding _get_select_path.

    After fixing the above mentioned, I was able to modify FBox.pm to solve my initial problem.

    I found that if the multiple option was selected, a file name was returned.

    So I modified the routine 'ActivateEnt'as follows

    sub ActivateEnt {

    my $w = shift;

    if ($w->cget(-multiple)) {

    # For the multiple case we have to be careful to get the file

    # names as a true list, watching out for a single file with a

    # space in the name. Thus we query the IconList directly.

    $w->{'selectFile'} = [];

    for my $item ($w->{'icons'}->Curselection) {

    $w->VerifyFileName($w->_get_from_icons($item));

    }

    } else {

    #my $ent = $w->{'ent'};

    #my $text = $w->_encode_filename($ent->get);

    #print "text : $text\n";

    #$w->VerifyFileName($text);

    $w->{'selectFile'} = [];

    for my $item ($w->{'icons'}->Curselection) {

    $w->VerifyFileName($w->_get_from_icons($item));

    }

    }

    }

    Cheers Jonathan