1

I have tried various ways to do it but I miss something. in the beggining I thought I need to create a style and than assign it to the button

st = ttk.Style()
st.configure('blueTButton', foreground="white", background="blue")
Btn.configure(style='blueTButton')

but I got an error: _tkinter.TclError: Layout blueTButton not found

so I tried this:

Btn.configure(foreground = 'red')
# and also
Btn.config(foreground = 'red')

and many other stupid attempts.

can anyone assist?

Ori
  • 367
  • 3
  • 15
  • Does this answer your question? [Create custom ttk style same as 'clam' ttk Theme (button widget specific)](https://stackoverflow.com/questions/42931533/create-custom-ttk-style-same-as-clam-ttk-theme-button-widget-specific) – stovfl Mar 15 '20 at 22:34
  • this is not dynamically changed. adding style to the button on creation is clear but not dynamically like on mouse click – Ori Mar 16 '20 at 15:26
  • ***"adding style to the button on creation is clear"***: Your ***"_tkinter.TclError: Layout blueTButton not found"***, tell otherwise. – stovfl Mar 16 '20 at 15:54

0 Answers0