I am creating a GUI with Tkinter and ttk, and I'm trying to create a custom map
to make ttk widgets blue on hover. I could apply that to all widgets with passing "."
as the first argument to ttk.Style().map(...)
.
import tkinter as tk
import tkinter.ttk as ttk
root = tk.Tk()
style = ttk.Style()
style.map(".", background=[("active", "blue")])
button = ttk.Button(root, text="An example button")
button.pack()
scrollbar = ttk.Scrollbar(root)
scrollbar.pack()
root.mainloop()
But now I want to exclude TButton
from this query. That is, I need to make all widgets but TButton
blue on hover. How can I do that?
Passing ".!TButton" as well as "!TButton" instead of "." has no effect.