使用ttk引导,我创建了一个主题,并希望将其应用于应用程序。到目前为止,我得到了这段代码:
class MainAppGui(tk.Tk):
def __init__(self):
tk.Tk.__init__(self)
self.title("Interpreter")
self.buildGUI()
self.style = ttk.Style(self)
self.style.configure('dark1', themes_file='..\\themes\\ttkbootstrap_themes_dark1.json')
def buildGUI(self):
self.InterBox = tk.Text(self)
self.but1 = ttk.Button(text='ABC')
self.InterBox.grid()
self.but1.grid()
但这种风格并不适用。这可能很容易,但我不知道怎么了。我第一次尝试改变风格
您必须指定
from ttkbootstrap import Style
https://github.com/israel-dryer/ttkbootstrap/blob/master/docs/tutorial.rst
相关问题 更多 >
编程相关推荐