#!/usr/bin/perl -w use Tk; use Tk::DirTree; use Cwd; use strict; my $Ladepfad; my $Datenspeichern = MainWindow->new; $Datenspeichern->title("Datei laden"); $Ladepfad= Cwd::cwd(); $Datenspeichern->Scrolled('DirTree', -scrollbars => 'osoe', -width => 30, -height => 10, -selectmode => 'browse', -exportselection => 1, -browsecmd => sub { $Ladepfad = shift }, # With this version of -command a double-click will # select the directory -command => sub { $ok = 1 }, # With this version of -command a double-click will # open a directory. Selection is only possible with # the Ok button. #-command => sub { $d->opencmd($_[0]) }, )->pack(-fill => "both", -expand => 1); # Set the initial directory $d->chdir($Ladepfad); MainLoop;