I am trying the validate the text input of an entry.
entry $w.e -validate key -vcmd "entryChanged $w.l $w.e"
I have the following callback defined.
proc entryChanged {l e} {
puts [$e get]
return 1
}
The problem is that get returns the previous value of the entry as the new value isn’t set until after the validation. My question is how do I access the new value? (value to be validated) I believe it has something to do with -textvariable, however, I can’t find much documentation on this.
You’ll want to have a good read through the Validation section of the
entrydocumentation. For example, try this