Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

change the color of the button on hovering tkinter

import tkinter as tk

def on_enter(e):
    myButton['background'] = 'green'

def on_leave(e):
    myButton['background'] = 'SystemButtonFace'

root = tk.Tk()
myButton = tk.Button(root,text="Click Me")
myButton.grid()


myButton.bind("<Enter>", on_enter)
myButton.bind("<Leave>", on_leave)

root.mainloop()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #change #color #button #hovering #tkinter
ADD COMMENT
Topic
Name
8+9 =