In my ctk (customtkinter) project, color of button changes when it gets pressed also text's color changes from white to black. When the button is pressed it calls gen_table which creates a ttkbootstrap table on ttkbootstrap window. Below are two images of button before and after it is pressed.
Here is the sample code
import customtkinter as ctk
import ttkbootstrap
from ttkbootstrap.tableview import Tableview
from ttkbootstrap.constants import *
def gen_table():
app = ttkbootstrap.Window()
coldata = ["LicenseNumber", "company name", "text"]
rowdata = [
("A123", "IzzyCo", 12),
]
dt = Tableview(
master=app,
coldata=coldata,
rowdata=rowdata,
searchable=True,
bootstyle=PRIMARY,
stripecolor=("lightgreen", None),
)
dt.pack(fill=BOTH, expand=YES, padx=10, pady=10)
app.mainloop()
if __name__ == "__main__":
mainWindow = ctk.CTk()
btn = ctk.CTkButton(
master=mainWindow,
text="something",
bg_color="transparent",
hover_color="red",
command=lambda: gen_table(),
).grid()
mainWindow.mainloop()