How can you make a dynamic status bar?

0 cody chamberlain · September 24, 2015
Hey so im VERY new to Python.  Watched all the intro vids and what not and all i could find was how to make the status bar:

status = Label(root, text="Awaiting commands...", bd=1, relief=SUNKEN, anchor=W)

status.pack(side=BOTTOM, fill=X)

Is there any way to make this status change with the click of a button? i tried just adding the first line to a new function with different text, but that did not seem to work.  

There must be a status.clear command or something?

Any assistance would be great.

Cheers

Post a Reply

Replies

Oldest  Newest  Rating
0 cody chamberlain · September 29, 2015
Found my solution, just had to add a global variable to allow my function to use it properly.

Thanks anyway!

Cody


def morningReports():
    global status
    status.pack_forget()
    status = Label(root, text="Launching Morning Report...", relief=SUNKEN, anchor=W)
    status.pack(side=BOTTOM, fill=X)
  • 1

Python

107,202 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator