How do I change the overall theme of a tkinter application?

前端 未结 3 1193
执念已碎
执念已碎 2020-12-20 21:26

I want to change the theme of my tkinter application to clam.

What is the code and where do I put it? I have tried:

from tkinter import *
from tkint         


        
3条回答
  •  轮回少年
    2020-12-20 21:48

    >>> from tkinter import ttk
    
    >>> s=ttk.Style()
    
    >>> s.theme_names() """======== if you are under win 8.1 you must see ..
     ('winnative', 'clam', 'alt', 'default', 'classic', 'vista', 'xpnative') you can use for example 'clam' ===== """
    
    >>> s.theme_use('clam')
    

提交回复
热议问题