Overwriting over label widget.
Example:
from tkinter import *
my_window = Tk()
my_window.title("This is example")
my_window.geometry("800x350+450+86")
my_window.config(bg="#7CFC00")
stable_text = "Textvarialble is Update Using Button Click"
def update():
global stable_text
lbl.config(text=stable_text)
btn = Button(my_window,text="Please Update", command=update, height=2,
width=15,bg="#FFB6C1", font=("Times", 20, "bold"))lbl = Label(my_window,text="If You Click Button then i am Updated",
font=("times",20, "bold"))
lbl.pack(pady=20)
btn.pack(pady=10)
btn = Button(my_window,text="Please Update", command=update, height=2,
width=15,bg="#FFB6C1", font=("Times", 20, "bold"))
width=15,bg="#FFB6C1", font=("Times", 20, "bold"))
lbl = Label(my_window,text="If You Click Button then i am Updated",
font=("times",20, "bold"))
font=("times",20, "bold"))
lbl.pack(pady=20)
btn.pack(pady=10)
btn.pack(pady=10)
my_window.mainloop()
Post a Comment