| 1 |
#!/usr/local/bin/perl -w |
| 2 |
use Tk; |
| 3 |
require Tk::TextUndo; |
| 4 |
|
| 5 |
use Carp; |
| 6 |
|
| 7 |
$SIG{__DIE__} = \&Carp::confess; |
| 8 |
|
| 9 |
my $mw = MainWindow->new; |
| 10 |
|
| 11 |
|
| 12 |
# Uncomment next line to avoid the warning - this a test of the warning |
| 13 |
# use Tk::TextUndo; |
| 14 |
my $t1 = $mw->Scrolled('TextUndo', -wrap => 'none'); |
| 15 |
my $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 |
|
| 21 |
opendir(DIR,'.'); |
| 22 |
my $name; |
| 23 |
foreach $name (readdir(DIR)) |
| 24 |
{ |
| 25 |
$lb->insert('end',$name) if (-T $name); |
| 26 |
} |
| 27 |
closedir(DIR); |
| 28 |
MainLoop; |