Sep-29-2020, 01:40 PM
I got good code from other forum! THANK YOU SOCTTY101!
here what it's works!
here what it's works!
import tkinter as tk def pressedInArea(x, y, x1, y1 ,x2 ,y2): return x > x1 and x < x2 and y > y1 and y < y2 def checkPosition(event): print(event.x,event.y) print(pressedInArea(event.x,event.y,0,0,100,100)) root = tk.Tk() c = tk.Canvas(root,width=400,height=400) c.grid() c.bind("<Button-1>", checkPosition)