How to get the values of spinbox from and to in a function?
sbDays=tk.Spinbox(frame,from_=0,to=366)
sbDays.place(relx=initialX,rely=yDistance)
sbDays.configure(validate='all',validatecommand=(windows.register(validate),'%P'))
def validate(userInput):
if userInput=="":
return True
try:
val=int(float(userInput))
except ValueError:
return False
return val>=0 and val<=366
Instead of return val>=0 and val<=366
. I need this:
minVal=spinbox 'from' value of '0'
maxVal=spinbox 'to' value of '366'
return val>=minVal and val<=maxVal
In C#, something like this:
minVal=this.From()
maxVal=this.To()