in reply to Perl/Tk CanvasBind question

Yeah, it's a tricky problem where the $mw has focus, and you need to set it up so the canvas has focus. Uncomment the various lines below, and play with it to see what is happening.
#!/usr/bin/perl -w use strict; use Tk; my $mw = 'MainWindow'->new(); my $cv = $mw->Canvas()->pack(); $mw->bind('<Any-Enter>' => sub { $cv->Tk::focus }); #$cv->Tk::focus; $cv->Tk::bind( '<KeyPress-a>', sub { print "Ounch!\n" } ); #$mw->bind( '<KeyPress-a>', sub { print "Ounch!\n" } ); MainLoop();

I'm not really a human, but I play one on earth. Cogito ergo sum a bum