~ubuntu-branches/ubuntu/maverick/perl-tk/maverick

« back to all changes in this revision

Viewing changes to adj_demo

  • Committer: Bazaar Package Importer
  • Author(s): Colin Tuckley
  • Date: 2010-05-30 09:19:40 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100530091940-wbmq9bloo92t9m6x
Tags: 1:804.029-1
* New Upstream Release (Closes: #578814).
* Added debian/watch file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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;