如何更改组合框列表视图的样式?
以下是目前代码的一部分:
style = ttk.Style()
style.configure("BW.TLabel", foreground="black", background="#20252b",
insertbackground="white", fieldbackground= 'blue')
optmn = ttk.Combobox(self, style="BW.TLabel")
optmn.place(x=140, y=200, width=150, height=25)
如何访问组合框列表视图的样式?
示例图片:
解决方法:
找到了!更改组合框列表视图的BG的方法是:
import ttk
import Tkinter
root = Tkinter.Tk()
root.option_add("*TCombobox*Listbox*Background", 'green')
combo = ttk.Combobox().pack()
root.mainloop()