【发布时间】:2017-02-16 16:42:24
【问题描述】:
我浏览了多个网站,但只给了我一半满意的答案,我将如何为 Tkinter OptionMenu Widget 的每个部分着色?
代码片段:
from tkinter import *
root = Tk()
text = StringVar()
fr = Frame (root,bg="yellow")
fr.grid()
menu = OptionMenu (fr, text, "hi", "there")
menu.grid (pady=50, padx=50)
# Pretty colouring goes here
# Or ugly yellow, I don't mind
menu ["menu"] ["bg"] = "yellow"
menu ["bg"] = "yellow"
menu ["activebackground"] = "green"
root.mainloop()
还是我应该放弃并满足于灰色?
【问题讨论】:
标签: python python-3.x tkinter colors optionmenu