📜  python optionmenu tkinter - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:34.595000             🧑  作者: Mango

代码示例1
from tkinter import Tk, StringVar, OptionMenu, mainloop
parent = Tk()
varList = StringVar(parent)
varList.set("Red")
om = OptionMenu(parent, varList, "Yellow", "Pink", "RED", "Brown", "Black", "Blue")
om.pack()
parent.mainloop()