1 year ago
#369313
Dodu
StringVar is not working inside the Optionmenu
I cannot get the StringVar class to work in my OptionMenu widget, it just appears blank in the OptionMenu. This works on my main window but not this pop-up window here is my code.
def create_new():
new = tk.Tk()
new.geometry('300x400')
new.title('Create New Project')
l1 = Label(new, text = 'Name of the Project: ', font = ('Arial', 13))
name = Entry(new)
menu = StringVar()
menu.set('Type of Project')
drop = OptionMenu(new, menu, 'Type of Project', 'Photo Editing', 'lol')
l1.pack()
name.pack()
drop.pack()
Note: I am creating another tkinter window for this.
The optionmenu appears like this The option menu is just empty
python
python-3.x
python-3.6
tkinter.optionmenu
0 Answers
Your Answer