in reply to Generic Entry widget validation
Generally, there is a way to send arguments to Tk callbacks, for instance this example (from Mastering Tk):
$key is an argument sent to the &key subroutine. Note that $key has a lexical binding, it is assigned when the foreach is executed.foreach my $key ( qw/0 1 2 3 4 5 6 7 8 9/ ) { $mw->bind( "<Key-$key>" => [\&key, $key] ); $mw->bind( "<KP_$key>" => [\&key, $key] ); }
|
|---|