May-10-2021, 01:08 AM
(May-09-2021, 08:36 AM)andy Wrote: I am relatively new in Tkinter and trying to achieve a glow effect on hover on clickable objects.
I have got this far in my effort which I am ashamed to share but everybody has to take a start from somewhere so why not.
from tkinter import * def changeOnHover(button, colorOnHover, colorOnLeave): button.bind("<Enter>", func=lambda e: button.config( background=colorOnHover)) button.bind("<Leave>", func=lambda e: button.config( background=colorOnLeave)) root = Tk() myButton = Button(root, text="On Hover - Background Change", bg="yellow") myButton.pack() changeOnHover(myButton, "red", "yellow") root.mainloop()P.S. I have tried multiple solutions from google and they were a bit confusing for me and right now i am experiencing creativity blockage so cant think much about how to achieve my desired results .
(May-09-2021, 09:49 AM)Yoriz Wrote: I think you might be better off with creating images for the button, you can then create the exact glow that you want and swap images on entering and leaving like in the following youtube video.
Tkinter: Button Animation On Hover! Easy and Quick!
First of all thanks for your contribution, Yeah I already looked into stuff like this, but adding images will eventually increase the size of my page, Isn't there a more efficient way to achieve the desired results? or I should stick to the course you mentioned.