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

« back to all changes in this revision

Viewing changes to lbformat_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 strict;
3
 
use Tk;
4
 
use Tk::Font;
5
 
 
6
 
my $mw = MainWindow->new;
7
 
my $font = $mw->Font(family  => 'courier', point => 140, weight => 'bold', slant => 'r');
8
 
my $lb = $mw->Scrolled('Listbox', -font => $font)->pack(-expand => 1, -fill => 'both');;
9
 
$mw->Button(-text => 'Quit', -command => [destroy => $mw])->pack;
10
 
 
11
 
opendir(DIR,".") || die "Cannot opendir '.':$!";
12
 
foreach (sort readdir(DIR))
13
 
 {
14
 
  my $size = (stat($_))[7];
15
 
  $lb->insert('end',sprintf("%6d $_",$size));
16
 
 }
17
 
 
18
 
MainLoop;
19