This is my first post, so please be gentle if I have made any noob mistakes :)
I have found a post that attempts to tackle this problem, but the solutions provided are not very simple, or complete.
see Using Tk::Text and '<<Modified>>'
I need:
I am looking for something as simple as (or as close as possible):
#!/usr/local/bin/perl use warnings; use strict; use Tk; # Global variables my $entry_val; # Main Window my $mw = new MainWindow; $mw->Entry( -validate=>"all", -validatecommand=>\&handleEvent, -textvariable=>\$entry_val, )->pack(); MainLoop; # Callbacks sub handleEvent { my ($new_val, $chars_2_change, $curr_val, $index, $action) = @_; # do nothing if No Change and No Force Validate if (!$chars_2_change && $action != -1){ return; } # do something meaningful here. # for now, just print the $new_val print $new_val."\n"; }
While the above code works great, it only satisfies 2 out of my 3 requirements. I am hoping that I have missed a widget that provides this functionality simply, or some option(s) of Entry that I may have overlooked to provide scrollable multi-line support.
In reply to using TK Text (or something similar), is there a simple way to get the -validate=>"all" functionality in TK Entry? by noelgolding
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |