हम टिंकर में एक बटन विजेट को विभिन्न तरीकों से अपडेट कर सकते हैं, उदाहरण के लिए, हम इसका आकार बदल सकते हैं, इसकी पृष्ठभूमि का रंग बदल सकते हैं, या इसकी सीमा हटा सकते हैं, आदि। निम्नलिखित उदाहरण में, हम तीन बटन विजेट और प्रत्येक बटन बनाएंगे, क्लिक करने पर, उनकी सुविधाओं को अपडेट करने के लिए एक अलग फ़ंक्शन को कॉल करेगा।
उदाहरण
# 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() आउटपुट
निष्पादन के बाद, यह सबसे पहले निम्न विंडो दिखाएगा -

जब आप "बटन का आकार बढ़ाएँ" . पर क्लिक करते हैं , यह निम्नलिखित आउटपुट का उत्पादन करेगा -

"पृष्ठभूमि का रंग बदलें" . क्लिक करने पर , यह निम्नलिखित आउटपुट देगा -

अगर आप "सीमा हटाएं" . पर क्लिक करते हैं , यह निम्नलिखित आउटपुट का उत्पादन करेगा -
