हम Tkinter में Button विजेट को विभिन्न तरीकों से अपडेट कर सकते हैं, उदाहरण के लिए, हम इसका आकार बदल सकते हैं, इसका बैकग्राउंड कलर बदल सकते हैं, या इसका बॉर्डर हटा सकते हैं, आदि। निम्नलिखित उदाहरण में, हम तीन Button विजेट बनाएंगे और प्रत्येक बटन, क्लिक करने पर, अपनी सुविधाओं को अपडेट करने के लिए एक अलग फ़ंक्शन कॉल करेगा।
उदाहरण
# Import the required library from tkinter import * from tkinter import ttk # Create an instance of tkinter frame win = Tk() # Define geometry of the window win.geometry("700x300") # Function to Increase the Size of the Button def Button_Size(): button1.configure(font=('Calibri 20 bold')) # Function to change the background color def Button_Color(): button2.configure(bg='green') # Function to Remove Border def Button_Border(): button3.configure(borderwidth=0) # First Button button1=Button(win, text="Increase the Button Size", command=Button_Size) button1.pack(pady=20) # Second Button button2=Button(win, text="Change the Background Color", command=Button_Color) button2.pack(pady=20) # Third Button button3 = Button(win, text="Remove the Border", command=Button_Border) button3.pack(pady=20) win.mainloop()आउटपुट
निष्पादन पर, यह पहले निम्नलिखित विंडो दिखाएगा:

जब आप "Increase the Button Size" पर क्लिक करते हैं, तो यह निम्नलिखित आउटपुट देगा:

"Change the Background Color" पर क्लिक करने पर, यह निम्नलिखित आउटपुट देगा:

यदि आप "Remove the Border" पर क्लिक करते हैं, तो यह निम्नलिखित आउटपुट देगा:
