in reply to Bug: Tk::Entry 804.027 validate?
Validate is intended for inspecting the value of something entered into the Entry widget. Some tidbits from the perldoc:
The characters to be added (or deleted). This will be "undef" if validation is due to focus, explcit call to validate or if change is due to "-textvariable" changing.
So you have undef values poping in there, when textvariable change occurs.
In general, the textVariable and validateCommand can be dangerous to mix. If you try set the textVariable to something that the validateCommand will not accept it will be set back to the value of the entry widget. Using the textVariable for readonly purposes will never cause problems.
So my advice is to redesign your script, to check for values in another way, rather than relying on the validate callback.
Why design something to use something which may go undef? You could just as easily put the value-check in the button callback( or wherever you set $entryText ).
If you really want to pursue this, you should probably ask on comp.lang.perl.tk. where one of the Tk internals experts may know something. </2cents>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Bug: Tk::Entry 804.027 validate?
by strat (Canon) on Jul 07, 2007 at 09:39 UTC | |
by zentara (Cardinal) on Jul 07, 2007 at 15:41 UTC |