From 63ed0abc98a7fceec94dd704905e279bc2506abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A9sir=C3=A9=20Werner=20Menrath?= Date: Sat, 26 Oct 2024 12:31:53 +0200 Subject: [PATCH] =?UTF-8?q?testtheme.py=20gel=C3=B6scht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- testtheme.py | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 testtheme.py 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()