Home > OS >  Is there any way to remove the click animation in Python Tkinter?
Is there any way to remove the click animation in Python Tkinter?

Time:12-27

When I click a button in Tkinter, an effect shows up. Can I somehow remove it?

button button when clicked

I tried to google the problem, but found nothing useful :(

Btw, sorry for the bad English, I hope it's not too disturbing.

CodePudding user response:

You can disable the animation of a button by returning "break" in the widget's bind, which stops the propagation of bound functions.

So you can either alter the function you normally have bound to the button to return "break".

Or you can add another bind, this does however prevent any binds that are made after this one

CodePudding user response:

You can use relief='sunken', however, the style of the button will always appear to be pressed.

btn = Button(frame, text='Btn', relief='sunken')
  • Related