Mercury Platinum
Mercury Platinum

Reputation: 1569

ttk.Style not working although ttk does run my commands

Im trying to edit the style of my program using ttk.Style, so I wrote this

import tkinter as tk
import tkinter.ttk as ttk
class Application:
    def __init__(self):
        self.root = tk.Tk()
        self.root.minsize(width=400, height=400)
        self.root.maxsize(width=400, height=400)
        self.root.resizable(False, False)
        self.theme = ttk.Style()
        self.theme.theme_use('clam')
        self.button = tk.Button(self.root, text='Test')
        self.button.pack()

Yet when I run the code, nothing changes. I printed theme_use() and the theme is clam like I set, yet nothing happens. Is there anything I am doing wrong?

Upvotes: 0

Views: 762

Answers (1)

Bryan Oakley
Bryan Oakley

Reputation: 385900

You aren’t using any ttk widgets. The style only affects ttk widgets.

Upvotes: 1

Related Questions