टिंकर किसी ईवेंट को ट्रिगर करने के लिए बटन बनाने के लिए बटन विजेट प्रदान करता है। मान लीजिए कि हमने एक बटन बनाया है जो पहले से ही किसी एप्लिकेशन में अक्षम है। बटन की स्थिति बदलने के लिए, हम स्थिति . का उपयोग कर सकते हैं संपत्ति।
राज्य संपत्ति का उपयोग किसी एप्लिकेशन में एक बटन को सक्षम और अक्षम करने के लिए किया जाता है। एप्लिकेशन की स्थिति को बदलने के लिए, हमारे पास दो ऑपरेशन हैं:state=DISABLED और राज्य=सामान्य ।
उदाहरण
#Import the required libraries
from tkinter import *
#Create an instance of tkinter frame
win= Tk()
#Set the geometry of frame
win.geometry("650x450")
#Define a function for Button Object
def quit_win():
win.destroy()
#Create a button to quit the window
Button(win,text="Quit", command=quit_win, font=('Helvetica bold',20),
state= NORMAL).pack(pady=5)
win.mainloop() आउटपुट 1
बटन के अक्षम होने पर आउटपुट,

आउटपुट 2
आउटपुट जब बटन स्थिति =सामान्य
