Using bind events
#! /usr/bin/env python3 import tkinter as tk def on_leave(event): btn['bg'] = 'yellow' def on_enter(event): btn['activebackground'] = 'blue' root = tk.Tk() root.geometry('200x200') btn = tk.Button(text='Button') btn['font'] = 'sans 18 normal' btn.pack() btn.bind('<Leave>', on_leave) btn.bind('<Enter>', on_enter) root.mainloop()
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags