#!/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;
In reply to Tk bind question by yoda54
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |