Skip to content

Commit d05c00b

Browse files
authored
Update On Mouse Click.py
1 parent 11de6fe commit d05c00b

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Tkinter/Event Handling/On Mouse Click.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ def on_mouse_click(event):
99
print(f"Mouse clicked at ({event.x}, {event.y})")
1010

1111
label = tk.Label(root, text="Click anywhere on me", height=20)
12-
1312
label.pack()
14-
13+
# Bind function to label
1514
label.bind("<Button-1>", on_mouse_click)
1615
'''Output: Mouse clicked at (x, y)'''
1716

0 commit comments

Comments
 (0)