diff --git a/testtheme.py b/testtheme.py deleted file mode 100644 index fd3958d..0000000 --- a/testtheme.py +++ /dev/null @@ -1,27 +0,0 @@ -import tkinter as tk -from tkinter import ttk - -root = tk.Tk() - -# Pack a big frame so, it behaves like the window background -big_frame = ttk.Frame(root) -big_frame.pack(fill="both", expand=True) - -# Set the initial theme -root.tk.call("source", "TK-Themes/azure.tcl") -root.tk.call("set_theme", "light") - -def change_theme(): - # NOTE: The theme's real name is azure- - if root.tk.call("ttk::style", "theme", "use") == "azure-dark": - # Set light theme - root.tk.call("set_theme", "light") - else: - # Set dark theme - root.tk.call("set_theme", "dark") - -# Remember, you have to use ttk widgets -button = ttk.Button(big_frame, text="Change theme!", command=change_theme) -button.pack() - -root.mainloop()