use strict; use warnings; use Tk; my $mw = MainWindow->new; my $text = $mw->Text ()->pack (-expand => 'yes', -fill => 'both'); $text->bind ('', \&callback); MainLoop; sub callback { print "got a Control i\n"; }