Working with Tkinter, I am trying to make a label disappear and another appear in its place when a specific option is selected with MenuOption(). Can I accomplish this without the need of a "refresh" button?
updated with a sample of my code:
mGui = Tk()
mGui.geometry('570x130+700+200')
mGui.resizable(width = FALSE, height = FALSE)
mGui.title('Title')
mylist = ['henry', 'tom', 'phil']
someValue = StringVar()
mLabel = Label(text = 'name: ').grid(row = 0, column = 0, sticky = E)
someMenu = OptionMenu(mGui, someValue, *mylist)
someMenu.grid(row = 0, column = 1, sticky = W)
someMenu.config(width = 14, anchor = W)
mGui.mainloop()
So, if someMenu.get() == 'tom' i want to hide mLabel...
so i've added the following:
def something():
print someValue.get()
mylist = ['henry', 'tom', 'phil']
someValue = StringVar()
someValue.trace('w', something)
and am getting TypeError: 'NoneType' object is not callable.. hmmmmm