#Optionmenu.py
from tkinter import *
def ok ():
print('value is', v.get ())
root.quit()
root=Tk()
root. geometry ('300x300+280+280')
v=StringVar(root)
v.set('Python')
om=OptionMenu(root,v,'Python',' cpp','Java','Javaseriot', 'VBSer ipt')
om.pack()
button=Button(root,text='OK',command=ok)
button.pack()
root.mainloop()
选项菜单设计
最新推荐文章于 2024-08-22 22:01:15 发布