Hi , I have some question to ask
I just want to disable the button when i start my program
in attached image, it looks like the button is already disabled ,but its response to my click event or keyboard event
What should i do ?
Thank you for all answer
from Tkinter import *
def printSomething(event):
print("Print")
#Start GUI
gui = Tk()
gui.geometry("800x500")
gui.title("Button Test")
mButton = Button(text="[a] Print",fg="#000",state="disabled")
mButton.place(x=5,y=10)
mButton.bind('<Button-1>',printSomething)
gui.bind('a',printSomething)
gui.mainloop()
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…