Feb-14-2020, 08:12 AM
Thank You Larz60+!
I'm new in python.
You are right about the incomprehensibility of what I wrote.
I try to simplify:
Have a nice day!
I'm new in python.
You are right about the incomprehensibility of what I wrote.
I try to simplify:
from tkinter import * import math import numpy as np # omissis... def verifica(event=None): val1 = v1.get() * int(e1.get()) * 50 val2 = v2.get() * int(e2.get()) * 20 val3 = v3.get() * int(e3.get()) * 10 val4 = v4.get() * int(e4.get()) * 5 print (val1,val2,val3,val4) somma=val1+val2+val3+val4 print (somma) valtot=int(e0.get()) if somma > valtot: b0.config(state = 'disabled') #<--- this doesn't work!!! else: b0.config(state=NORMAL) #<--- this doesn't work!!! b0 = Button(gui, text="Split", state='normal', command=callback).place(x=100, y=155, height=20, width=100) b1 = Checkbutton(gui, text="fix", state='disabled', variable=v1, command=verifica).place(x=210, y=35, height=20, width=100)The problem lies in the fact that once the widgets (in this case b0 and b1) are set, I can no longer change their state (normal / disabled).
Have a nice day!