Juthware has asked for the wisdom of the Perl Monks concerning the following question:
...my $mw = MainWindow->new(); $mw->protocol(WM_DELETE_WINDOW=>\&exitfile); my $menuframe = $mw->Frame(-bd=>4, -relief=>'groove')->pack(-side=>'to +p', -fill=>'x', -expand=>'x');<br> my $canvasframe = $mw->Frame(-bd=>4, -relief=>'groove')->pack(-side=>' +bottom', -fill=>'both', -expand=>'both');
where the keypresses and actions are read from a file (you can view the whole source of the main module at http://sandyfleming.org/swposter_0_3.txt if you want). This works excellently for all keys except the Tab key. Pressing the tab key causes the focus to change so that from then on keys such as the arrow keys move the canvas about instead of doing the action I've bound to them. What am I doing wrong?my $canvas1 = $canvasframe->Scrolled('Canvas', -width=>'20i', -height= +>'10i', -background=>$papercolour)->pack(-fill=>'both', -expand=>'bot +h'); $canvasframe->focus; $mw->bind($keypress=>\&$action); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tab Key in Perl/Tk
by Courage (Parson) on Feb 24, 2005 at 10:13 UTC | |
by Juthware (Novice) on Feb 26, 2005 at 07:56 UTC | |
|
Re: Tab Key in Perl/Tk
by wolfger (Deacon) on Feb 24, 2005 at 13:58 UTC | |
by Juthware (Novice) on Feb 25, 2005 at 16:32 UTC | |
by wolfger (Deacon) on Feb 25, 2005 at 18:15 UTC |