The -validatecommand does not work if manually some text is written to the entry widget
See https://metacpan.org/pod/Tk::Entry#VALIDATION, by default no validation is performed
#!/usr/bin/perl -- use strict; use warnings; use Data::Dump qw/ pp /; use Tk; my $mw = tkinit; $mw->Entry( -validate => 'all', -validatecommand => sub { warn pp(\@_); return 1 if !length$_[0] or $_[0] =~ m{^\d+$}; return undef; }, )->pack; $mw->MainLoop;
In reply to Re^3: Perl Tk entry widget
by beech
in thread Perl Tk entry widget
by Mj1234
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |