yoda54 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use Tk; use strict; foreach (@ARGV) { my $x = MainWindow->new; $x->title("$_"); $x->Label(-text => "$_")->pack(-fill => 'both'); $x->bind("<Key-Escape>", sub { exit }); my $y = $x->Scrolled("Text", -height => 10, -scrollbars => + 'osoe')->pack(); open (F, "< $_") || die "Can't open"; while(<F>) { $y->insert('end', $_); } close(F); } MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk bind question
by integral (Hermit) on Feb 22, 2003 at 07:48 UTC |