Python - Tkinter not support MacOS Mojave Dark Mode

做~自己de王妃 提交于 2019-12-10 14:34:45

问题


I have a problem with the support of Dark Mode on MacOS in python Tkinter. I used python 3.6 with ActiveTlc 8.5 and the Dark Mode works fine, the window titlebar was dark, it's fine for me... but there were some problems with the <MouseWheel> support, then I upgraded python to 3.7.1 and the version of tlc is updated to 8.6.

But now the Dark Mode didn't work, and it's strange, why this is happening?

This is an example code:

from tkinter import *

if __name__ == '__main__':
    root = Tk()
    hero_text = Label(root, fg='white', bg='black', text='HERO TEXT')
    hero_text.grid(row=0, sticky=N+W)
    print(root.tk.exprstring('$tcl_library'))
    print(root.tk.exprstring('$tk_library'))
    root.mainloop()

来源:https://stackoverflow.com/questions/52929744/python-tkinter-not-support-macos-mojave-dark-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!