Tha*_*rub 1 python tkinter colors optionmenu python-3.x
我浏览了多个网站,只给了我一半满意的答案,我将如何为 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()
Run Code Online (Sandbox Code Playgroud)
还是我应该放弃并满足于灰色?
| 归档时间: |
|
| 查看次数: |
3935 次 |
| 最近记录: |