Answers for "python optionmenu tkinter"

2

python optionmenu tkinter

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()
Posted by: Guest on March-19-2021

Python Answers by Framework

Browse Popular Code Answers by Language