#!/usr/local/bin/perl -w

use Tk;
require FileDialog;

my $mw = MainWindow->new();


my $fdialog = $mw->FileDialog('Title'=>'Select File',
 				     'CreateFlag' => 0);
$fdialog->configure('Path' => "$ENV{'HOME'}",
                    'FileMask' => '*',
                    'ShowAllFlag' => 'NO',
                    grabflag => 1);

$mw->Button(-text => 'Choose File', 
            -command => 
            sub
             {
              my $fname = $fdialog->show(ChDirFlag => 1, 
                                         DisableShowAll => 'YES');
              print "Chose $fname\n";
             })->pack(-side => 'left', -fill => 'y');

$mw->Button(-text => 'Quit', 
            -command => [$mw, 'destroy']) ->pack(-side => 'left', -fill => 'y');

MainLoop; 


