Python tkinter使用默认Mac主题
我正在开发一个tkinter应用程序,我刚刚更新到python的最新版本(Python3.9.5),tkinter正在使用mac的默认主题,这与我的设计不符 我想要这个(灯光主题): 但我得到的是(黑暗主题): 是否有办法将主题更改为<代码>灯光代码>或检查当前的mac主题 我的代码:Python tkinter使用默认Mac主题,python,python-3.x,tkinter,python-3.9,tkinter-layout,Python,Python 3.x,Tkinter,Python 3.9,Tkinter Layout,我正在开发一个tkinter应用程序,我刚刚更新到python的最新版本(Python3.9.5),tkinter正在使用mac的默认主题,这与我的设计不符 我想要这个(灯光主题): 但我得到的是(黑暗主题): 是否有办法将主题更改为灯光或检查当前的mac主题 我的代码: from tkinter import * class Snipper: def __init__(self): self.root = Tk() self.root.title(&
from tkinter import *
class Snipper:
def __init__(self):
self.root = Tk()
self.root.title("snipper")
self.build()
# bring app to front after start
self.root.lift()
self.root.attributes('-topmost',True)
self.root.after_idle(self.root.attributes,'-topmost',False)
self.root.minsize(1000, 600)
self.root.mainloop()
s = Snipper()
这是所有小部件的问题,还是你只是问如何在根窗口上获得白色背景?我尝试了按钮和文本小部件,它们都是黑色的。所以是的,我认为tkinter和ttk附带的所有小部件都有问题。同时询问如何更改主题(在根目录和标题窗口中获得白色背景)。@NahuGere so
self.root.configure(bg=“white”)
对您不起作用这是否回答了您的问题?不,这不是我要找的