1#!/usr/local/bin/perl  -w
2use Tk;
3require Tk::TextUndo;
4
5use Carp;
6
7$SIG{__DIE__} = \&Carp::confess;
8
9my $mw = MainWindow->new;
10
11
12# Uncomment next line to avoid the warning - this a test of the warning
13# use Tk::TextUndo;
14my $t1 = $mw->Scrolled('TextUndo', -wrap => 'none');
15my $lb = $mw->Scrolled('Listbox');
16$lb->packAdjust(-side => 'left', -fill => 'both', -delay => 1);
17$lb->bind('<Double-ButtonRelease-1>',sub { $t1->Load($lb->getSelected) });
18
19$t1->pack(-side => 'right', -fill => 'both', -expand => 1);
20
21opendir(DIR,'.');
22my $name;
23foreach $name (readdir(DIR))
24 {
25  $lb->insert('end',$name) if (-T $name);
26 }
27closedir(DIR);
28MainLoop;
29