/usr/share/doc/libtk-filedialog-perl/examples/example.pl is in libtk-filedialog-perl 1.3-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #!/usr/bin/perl -w
# Originally found in the FileDialog.pm pod documentation
use Tk;
use Tk::FileDialog;
use strict;
my($main) = MainWindow->new;
my($Horiz) = 1;
my($fname);
my($LoadDialog) = $main->FileDialog(-Title =>'This is my title',
-Create => 0);
print "Using FileDialog Version ",$LoadDialog->Version,"\n";
$LoadDialog->configure(-FPat => '*pl',
-ShowAll => 'NO');
$main->Entry(-textvariable => \$fname)
->pack(-expand => 1,
-fill => 'x');
$main->Button(-text => 'Kick me!',
-command => sub {
$fname = $LoadDialog->Show(-Horiz => $Horiz);
if (!defined($fname)) {
$fname = "Fine,Cancel, but no Chdir anymore!!!";
$LoadDialog->configure(-Chdir =>'NO');
}
})
->pack(-expand => 1,
-fill => 'x');
$main->Checkbutton(-text => 'Horizontal',
-variable => \$Horiz)
->pack(-expand => 1,
-fill => 'x');
$main->Button(-text => 'Exit',
-command => sub {
$main->destroy;
})
->pack(-expand => 1,
-fill => 'x');
MainLoop;
print "Exit Stage right!\n";
exit;
|