First of all, thanks for pointing that out - you are absolutely right (no shocker there), removing that sleep fixes the double-Tab issue. Why am I using it? B/c that is what the code I borrowed had. Why did the original code have it? I believe to give it that flashing red background effect...something I can (and will) live without.
However, the issue is still there if a textvariable is pre-defined with a bad string (as I noted in the update to my OP). This is more important than the other issue, b/c this will definitely crop up. The textvariable may or may not be pre-defined before displaying the widget, but if it is, and it is invalid, I would like validation to work.
Any idea what is going on there?
Edit: seems to work if I first create the widgets, then go back and configure them:
for(1..6){ $entries{$_}{'entry'} = $fr->Entry(); $entries{$_}{'entry'}->configure( -textvariable => \$entries{$_}{'addy'}, -width => 3, # -validate => 'focusout', # -validatecommand => [ \&validate,$_,\%entries ], # -invalidcommand => [ \&show_invalid,$entries{$_}{'entry'},$_ ], ); $entries{$_}{'entry'}->pack(-side => 'left'); } for(1..6){ $entries{$_}{'addy'} = 'zz'.$_ if($_ == 3); $entries{$_}{'entry'}->configure( -validate => 'focusout', -validatecommand => [ \&validate,$_,\%entries ], -invalidcommand => [ \&show_invalid,$entries{$_}{'entry'},$_ ], ); }
In reply to Re^2: Tk::Entry and double-Tab key weirdness
by atreyu
in thread Tk::Entry and double-Tab key weirdness
by atreyu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |