Creating a Status Bar in Tkinter GUI

 

from tkinter import *

def updating():
    statusvar.set("Updating...")
    status_bar.update()
    import time
    time.sleep(2)
    statusvar.set("Updated")
       
root = Tk()

root.geometry("1000x600")
root.title("STATUS BAR Creating")

Button(root, text="Update", command=updating).pack(side=TOP)

statusvar = StringVar()
statusvar.set("Ready")

status_bar = Label(root, textvariable=statusvar, relief=SUNKEN, anchor=W)
status_bar.pack(side=BOTTOM, fill=X)

root.mainloop()




Comments

Popular posts from this blog

Quotation marks to wrap an element in HTML

What is the difference between iostream and iostream.h in cpp?

The Basic Structure of a Full-Stack Web App