in reply to Generic Entry widget validation

Here is a way. I have the validation set up to be between 0 and 100, as integer, but you can change the regex to include a . for real values.
#!/usr/bin/perl use strict; use warnings; use Tk; my $top = MainWindow->new(); my %entries; for(1..4){ $entries{$_}{'value'} ||= 0; $entries{$_}{'entry'} = $top->Entry( -textvariable => \$entries{$_}{'value'}, -width => 5, -validate => 'key', -vcmd => \&validate, )->pack; } MainLoop; #have to make sure empty value has numeric context sub validate{ my $val = shift; $val ||= 0; #get alphas and punctuation out if( $val !~ /^\d+$/ ){ return 0 } if (($val >= 0) and ($val <= 100)) {return 1} else{ return 0 } }

I'm not really a human, but I play one on earth. flash japh