This is a discussion on Entry -validatecommand issues - Perl ; Hello all, In my current application I have discovered a need to make an Entry widget do validation a little differently. I have an Entry which I wish to always contain EXACTLY TWO decimal digits, representing values between 0 (00) ...
Hello all,
In my current application I have discovered a need to make an Entry
widget do validation a little differently.
I have an Entry which I wish to always contain EXACTLY TWO decimal
digits, representing values between 0 (00) and 59 (yes, it's a time
entry). The current Entry validation paradigm allows me ONLY to
WHOLESALE ACCEPT or WHOLESALE REJECT any "proposed change," which I
submit is not sufficient here.
For example, if my Entry contains the value '00,' and my user places
the insertion cursor to the left of both digits and types a '1', my
validation callback routine gets invoked with a 'current' value of '00'
and a proposed value of '100' -- NEITHER of which is acceptable as the
"new value" of the Entry, in this particular context!
I would like to have -- indeed, in this application I NEED to have
-- a third option, namely, the ability to hand the Entry widget an
EXPLICIT "new value" string generated within my callback routine; in
this case, I would like the entered '1' to REPLACE the leftmost '0,'
making the Entry's new value '10'.
I expect the odds are pretty long AGAINST this kind of thing
becoming supported in the Entry widget "anytime soon." If I were in a
position to modify the Entry code myself, I would do so, but I'm not.
So is there an "official change-request submission procedure?" Is
there already a modified version of an Entry (or Text, or any other)
widget that already supports this kind of behavior? Can anybody
suggest an approach to the problem of accepting a user's "time" in
HH:MM:SS format while maintaining format-and-value correctness on a
keystroke-by-keystroke basis? I guess it doesn't even really HAVE to
be TEXTUAL input, if there's some other convenient/intuitive way of
representing "time"...
Thanks in advance for your responses.
Chris