in reply to Re: Re: changing the focusing-order in Tk
in thread changing the focusing-order in Tk
use Tk; use strict; use warnings; my $win = MainWindow->new(); $win->Button(-text => 'Other Window', -command => \&otherwindow)->pack +; sub otherwindow { my $otherwin = $win->Toplevel; my $foo = $otherwin->Entry->pack; my $bar = $otherwin->Entry->pack; my $baz = $otherwin->Entry->pack; &defineOrder(\$foo, \$bar, \$baz); } sub defineOrder { for (my $i = 0; defined($_[$i+1]); $i++) { ${$_[$i]}->bind('<Return>' , \${$_[$i+1]}->focus ); print ${$_[$i]}, "\n"; } ${$_[0]}->focus; # BTW: $foo->focus() wont work here.... } MainLoop();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re:^4 changing the focusing-order in Tk
by hiseldl (Priest) on Sep 28, 2002 at 22:34 UTC | |
by schweini (Friar) on Sep 29, 2002 at 02:14 UTC |