Python Forum
[Tkinter] Glow text of clickable object on hover with transition
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] Glow text of clickable object on hover with transition
#4
(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 Wall so cant think much about how to achieve my desired results Huh .

(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.
Reply


Messages In This Thread
RE: Glow text of clickable object on hover with transition - by andy - May-10-2021, 01:08 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] Hover over highlighted text and open popup window DrakeSoft 2 1,588 Oct-29-2022, 04:30 PM
Last Post: DrakeSoft
  [PyQt] Determining the format attributes on text in a QTextEdit object DrakeSoft 7 3,655 Apr-18-2022, 06:40 PM
Last Post: DrakeSoft
  [PyQt] AttributeError: 'NoneType' object has no attribute 'text' speedev 9 11,595 Sep-25-2021, 06:14 PM
Last Post: Axel_Erfurt
  [Tkinter] Clickable Rectangles Tkinter Canvas MrTim 4 9,021 May-11-2021, 10:01 PM
Last Post: MrTim
  [Tkinter] Hover event DT2000 9 7,498 Apr-19-2020, 05:51 AM
Last Post: DT2000
  Making text clickable with binding DT2000 10 5,238 Apr-02-2020, 10:11 PM
Last Post: DT2000
  [PyQt] Ubuntu Taskbar icon shows title as "Unknown" while hover davidmuni 3 3,817 Jan-28-2020, 01:13 PM
Last Post: davidmuni
  Help: Enlarge image on hover morganruben 1 3,261 May-22-2018, 10:08 AM
Last Post: j.crater
  (pyQt/pySide)setStyleSheet(border…) makes QPushButton not clickable in Maya vladlenPy 0 4,774 Apr-15-2018, 12:41 PM
Last Post: vladlenPy
  pyqt clickable pushbutton problem pythonck 1 7,708 Dec-12-2017, 03:38 PM
Last Post: pythonck

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020