我正在尝试使用tkinter主题中的一些主题来设计我的theme的样式。我找到了下面的代码:
from ttkthemes import ThemedStyle
import tkinter as tk
from tkinter import ttk
app = tk.Tk()
app.title('App')
style = ThemedStyle(app)
style.set_theme("black")
tktext = tk.Label(app, text=" tk Label")
tktext.pack()
tkbutton = tk.Button(app, text="tk Button")
tkbutton.pack()
text = ttk.Label(app, text=" ttk Label")
text.pack()
button = ttk.Button(app, text="ttk Button")
button.pack()
app.geometry('200x200')
app.mainloop()在本主题中:Python - How do I add a theme from ttkthemes package to a guizero application?
但我有一个问题,那就是当我运行程序时,主题没有覆盖整个根窗口,只有来自ttk的按钮或标签采用了主题(使用windows10),.I在其他一些代码中尝试过,每次都有相同的问题。这有什么问题?ttktheme
发布于 2019-11-25 04:00:02
主题仅适用于ttk模块中的小部件。对于不在ttk中的小部件,比如文本小部件,您必须单独配置它们。
https://stackoverflow.com/questions/59020589
复制相似问题