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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.