I need to create a choice box
where i can click on arrow and it give me list of choices.
And if i click on one of them it will change it in that first rectangle.
Its possible to do something like this?
Thank you for any idea.
您还可以尝试OptionMenu http://effbot.org/tkinterbook/optionmenu.htm:
from Tkinter import *
root = Tk()
choices = ['GB', 'MB', 'KB']
variable = StringVar(root)
variable.set('GB')
w = OptionMenu(root, variable, *choices)
w.pack(); root.mainloop()
或者您可以尝试使用Combobox
:
from ttk import *
from Tkinter import *
root = Tk()
choices = ['GB', 'MB', 'KB']
variable = StringVar(root)
variable.set('GB')
w = Combobox(root, values = choices)
w.pack(); root.mainloop()
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)