in reply to Re: Tk::Entry and double-Tab key weirdness
in thread Tk::Entry and double-Tab key weirdness
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'},$_ ], ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Tk::Entry and double-Tab key weirdness
by zentara (Cardinal) on May 26, 2012 at 11:12 UTC | |
by atreyu (Sexton) on May 29, 2012 at 15:44 UTC | |
by zentara (Cardinal) on May 29, 2012 at 20:28 UTC | |
by atreyu (Sexton) on May 30, 2012 at 14:35 UTC | |
by zentara (Cardinal) on May 31, 2012 at 10:57 UTC | |
| |
|
Re^3: Tk::Entry and double-Tab key weirdness
by Khen1950fx (Canon) on May 25, 2012 at 20:25 UTC | |
by atreyu (Sexton) on May 29, 2012 at 15:34 UTC | |
|
Re^3: Tk::Entry and double-Tab key weirdness
by Anonymous Monk on May 26, 2012 at 08:02 UTC |