and in gerneral also work under win32 , but : i can only access the directories of one harddrive (the current one) ... Is there a way to change that or is there another tk-widget more suitable for this problem...sub select_dir{ my $choose_dir = $main->Toplevel; $choose_dir->title("Choose directory:"); my $ok = 0; my $frame = $choose_dir->Frame->pack( -fill => "x", -side => "bottom" ); my $curr_dir = Cwd::cwd(); my $scrolled; $scrolled = $choose_dir->Scrolled('DirTree', -scrollbars => 'osoe', -width => 35, -height => 20, -selectmode => 'browse', -exportselection => 1, -browsecmd => sub { $curr_dir=shift }, -command => sub { $ok = 1 }, )->pack(-fill => "both", -expand => 1); $scrolled->chdir($curr_dir); $frame->Button(-text => 'Ok', -command => sub { $ok = 1 } )->pack(-side => 'left'); $frame->Button(-text => 'Cancel', -command => sub { $ok = -1 } )->pack(-side => 'left'); $frame->waitVariable(\$ok); $status->configure(-text=>"Status area"); if ($ok == 1){ $choose_dir->withdraw; if (-x $curr_dir){ return $curr_dir; } tackle_err ("$1 doesn't exist"); return; } else { $choose_dir->withdraw; return; } }
there were 2 very usefull answers:
Originally posted as a Categorized Question.
In reply to Tk::DirTree & Win by NaSe77
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |