Hi
I need a spinbox which when created can read a variable (which is an integer) from another location and use that variable for the starting value. i also need to only allow integers be input into the text field by keyboard (and only has high as 999). lastly, whenever the spinbox value is changed (either by keyboard input or by clicking on the arrows) i need to be able to verify that it is an integer and then save its value into another location.
i have tried to do these things but without success. currently i have this (it has been cut out of my main program:
i noticed that even with validate set to ALL it only runs the command validate once and that is when the spinbox is first created.
any help would be greatly appreciated, but please try and keep it simple i am still very new to this
thanks
I need a spinbox which when created can read a variable (which is an integer) from another location and use that variable for the starting value. i also need to only allow integers be input into the text field by keyboard (and only has high as 999). lastly, whenever the spinbox value is changed (either by keyboard input or by clicking on the arrows) i need to be able to verify that it is an integer and then save its value into another location.
i have tried to do these things but without success. currently i have this (it has been cut out of my main program:
Code:
resistanceEntry = Spinbox(resistorFrame, from_=1, to=999, width=10, wrap=True, validate=ALL, validatecommand=validate)
def validate():
print "VALIDATE"
any help would be greatly appreciated, but please try and keep it simple i am still very new to this
thanks
Comment