from tkinter import *
def customMouse(e=None):
x = e.x
y = e.y
label.place_configure(x=x,y=y-20)
root = Tk()
label = Label(master=root,text="^")
label.place(x=0,y=0)
root.bind('<Motion>',customMouse)
root.mainloop()
My problem is simple:
When I use e.x or e.y this returns the x and y coordinates of the mouse according to the widget over which the mouse is.
Also, I try using e.x_root and e.y_root this will return the mouse position of the desktop, not the Tkinter window.
My expected Output is that whenever my mouse moves then the label will place on the mouse's position.