I have an application to use this vcmd command with and don't understand it entirely. Here is my validation code:
def validate(self, action, index, value_if_allowed, prior_value, text, validation_type, trigger_type, widget_name):
if not int(action):
return True
elif text in '0123456789.-+':
try:
float(value_if_allowed)
return True
except ValueError:
return False
else:
return False
I don't get why in this code I need all of these:
action, index, value_if_allowed, prior_value, text, validation_type, trigger_type, widget_name
Why do I need all of these specific to my validation code for it to function correctly and what use are they? The documentation I've seen made sense but some of those '%s', '%i' stuff seemed unnecessary for my specific code yet it only works with all of them included like so:
vcmd = (self.master.register(self.validate), '%d', '%i', '%P', '%s', '%S', '%v', '%V', '%W')
I also want to know what self.master.register does please, I still can't figure that one out.
I have not seen direct answers to my specific question on validation. I edited another post on validation of mine with the information in this post for someone. I need to understand the command well, therefore I have made a separate post on this specific question.