tkinter disable button code example
Example 1: make tkinter button disable
button['state'] = 'disabled'
Example 2: make tkinter btn disable
btn1['state'] = 'normal'
btn1['state'] = 'disabled'
Example 3: button state change in tknter
from tkinter import *
fenster = Tk()
fenster.title("Window")
def switch():
if(b1['state']==NORMAL):
b1["state"] = DISABLED
b2["text"]="enable"
elif (b1['state']==DISABLED):
b1["state"]=NORMAL
b2["text"]="disable"
b1=Button(fenster, text="Button")
b1.config(height = 5, width = 7)
b1.grid(row=0, column=0)
b2 = Button(text="disable", command=switch)
b2.grid(row=0,column=1)
fenster.mainloop()