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
#1
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 .
Reply


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

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