tkinter optionmenu first option vanishes
问题 A ttk optionmenu widget starts out with all of its values in the dropdown. Upon selecting any value, the first value in the list vanishes, never to reappear... Does anyone know why? Is this a feature of the widget's design? Try it with the following: import tkinter.ttk as ttk import tkinter as tk a = tk.Tk() options = ['1', '2', '3'] value = tk.StringVar() masterframe = ttk.Frame() masterframe.pack() dropdown = ttk.OptionMenu(masterframe, value, *options) dropdown.pack() a.mainloop() Note -