所以我正在尝试构建一个小应用程序,我真的很喜欢 Guizero 包,它很简单,事件驱动的编程。
它似乎唯一缺少的是实现主题更改的方法,因此目前看起来确实过时了。有没有办法应用 Tkinter 包之类的?
下面是我尝试过的一些代码,它甚至可以正确打印“vista”,但它似乎没有实现实际的主题更改。
from tkinter import *
from guizero import *
import tkinter.ttk as ttk
app = App(title="Application Name", layout="grid", height=200, width=600) # Random app name
app.tk.iconbitmap("someicon.ico") # I got this to work
s=ttk.Style()
#app.ttk.Style().theme_use('default')
print(s.theme_names()) # loads themes
print(s.theme_use()) # shows potential theme names ('winnative', 'clam', 'alt', 'default', 'classic', 'vista', 'xpnative')
s.theme_use('vista')
print(s.theme_use()) # prints 'vista'
app.style = s
print(app.style.theme_use()) # prints 'vista'
app.display()