from Tkinter import *
class StatusBar(Frame):
def __init__(self, master):
Frame.__init__(self, master)
self.label = Label(self, bd=1, relief=SUNKEN, anchor=W)
self.label.pack(fill=X)
def set(self, format, *args):
self.label.config(text=format % args)
self.label.update_idletasks()
def clear(self):
self.label.config(text="")
self.label.update_idletasks()
root = Tk()
root.update()
d =StatusBar(root)
d.pack()
mainloop()
Hi Friend.This is my code for Status bar.Even though i didn’t get any error or warning. I had failed to obtain the status bar. But my Widget is getting opened with empty in it.Can any one please help me in this aspect.
Thank you
It’s there; it’s just very small because none of the widgets requested much space.
If you put some text in the Label, or gave
roota geometry, it would be easier to see:By the way, to allow the text inside the label to change, use a
tk.StringVar.Calling
self.variable.set(...)will change the label’s text. And to clear it just callself.variable.set('').