from tkinter import * root = Tk() root.geometry('600x600') def focIn(event): print('Наведення на квадрат') canv.config(bg='yellow') def focOut(event): print('Відведення від квадрату') canv.config(bg="blue") def clickMouse(event): print('Клацання на полотні') canv.config(bg='green') def clickOff(event): print('Кнопку миші не натиснуто') canv.config(bg='red') canv = Canvas(root, width=100, height=100, bg="black", cursor="hand2") canv.bind('',focIn) canv.bind('',focOut) canv.bind('',clickMouse) canv.bind('',clickOff) canv.place(x=256, y=256) mainloop()