below a simple code, it's just a button widget placed in a window:
import tkinter as tk
from tkinter import ttk
class MainWindow:
def __init__(self):
self.parent=tk.Tk()
self.parent.geometry("494x410+370+100")
self.parent.title("Test")
Button = ttk.Button(self.parent, text="My Button", command=self.DoNothing)
Button.place(x=16, y=16)
self.parent.mainloop()
def DoNothing(self):
pass
if __name__=="__main__":
app=MainWindow()
is it possible to put this button in "highlighted" state? I mean, is it possibile to change its color like when the mouse cursor stays on it? see the attached image:
in my real software, I have some buttons. all of them open a different menu and when I'm working in one of them, I would very like to remember in which menu I am. to do that I thought to put the button in "highlighted" state and come back to the original one when I click on another button (when I change the menu).
if it is not possible, is there the possibility to change the button colors to make it like when it is in "highlighted" state?