in reply to Tk::DirTree freezes program

This code works fine for me on Slackware linux. Maybe since it only affects certain variants of OS, it's permissions releated? ( you are jumping up out of your homedir). Also checjk the buglist and try the latest version of Tk ...... Tk-804.028 which has fixed many bugs.
#!/usr/bin/perl use warnings; use strict; use Tk; my $defaultdir = '/home'; #defaults to current dir my $mw = MainWindow->new( -title => "Test DirSelect" ); my $selbut = $mw->Button( -text => 'Select', -command => [ \&dirsel, $defaultdir ] )->pack(); my $quitbut = $mw->Button( -text => 'Exit', -command => sub { exit } )->pack(); MainLoop; ################################################# sub dirsel { my $defaultdir = shift; my $dir = $mw->chooseDirectory( -initialdir => $defaultdir ); print "$dir\n"; } __END__

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

Replies are listed 'Best First'.
Re^2: Tk::DirTree freezes program
by ddexter (Initiate) on May 28, 2008 at 14:42 UTC
    Hi Zentara, Thanks for the suggestion. Your code seems to work which leads me to believe that there is a bug in the newest DirTree package (I am using Tk-804.028 now). I will try to figure out what is causing it and submit a bug report. Until then, I think I will change my code to use chooseDirectory.