in reply to Tab Key in Perl/Tk
I had the opposite problem a while back. I had a text field in which the tab key entered \t when I wanted it to shift focus. Simply using bind didn't work. Here is what I wound up doing:
my $t1 = $mw->Text( -background=>"navy", -foreground=>"white", -height=>35, -width=>80, -wrap=>"word", -selectbackground=>"blueviolet" ); $t1->bindtags( [ ($t1->bindtags)[1,0,2,3] ] ); + # fix the bindtags order so that widget events are + # processed before class events $t1->bind("<Tab>", sub { $t1->focusNext; Tk->break; }); + #Fix tab to shift focus, not print a tab.
Perhaps something similar is what you need.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tab Key in Perl/Tk
by Juthware (Novice) on Feb 25, 2005 at 16:32 UTC | |
by wolfger (Deacon) on Feb 25, 2005 at 18:15 UTC |