QUESTION IMAGE
Question
question # 7
dropdown
complete the code in this program that responds to moving a mouse over a message box.
from tkinter import *
def motion(event):
print(\location: (\,event. ◯ , \,\, event. ◯ , \)\)
return
mywindow = tk()
eventarea = message( mywindow, text = hello)
Step1: Identify coordinates in Tkinter
In Tkinter, when handling mouse - motion events, the x and y attributes of the event object represent the horizontal and vertical coordinates respectively.
Step2: Fill in the blanks
The code should print the x and y coordinates of the mouse position when it moves over the message box. So the blanks should be filled with x and y.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
print("Location: (",event.x,":", event.y,")")