in reply to Re: Entry widget, default value and validatecommand
in thread Entry widget, default value and validatecommand

Thank you so much!

I modified your code to read -validatecommand=> sub{$_[0] =~ /^\d*\${0,1}$/}, so my user can enter as many digits as he wants, but still only digits and the default value shows up!

I Love it!

Replies are listed 'Best First'.
Re^3: Entry widget, default value and validatecommand
by GrandFather (Saint) on Aug 01, 2005 at 05:12 UTC

    Note that there is a subtle difference between this code and your original code. Your original code was validating new characters as they were added (and characters being deleted). This code validates the whole string, which I suspect is more likely what you wanted anyway. This way you can easily add range validation and stuff too.


    Perl is Huffman encoded by design.