Jul-10-2023, 06:14 AM
I have a single window (root):
window = customtkinter.CTk() which holds several widges as (mapview,labels,combos....).
I use this function to get mouse x and y position, while mouse is moving:
It shows coordinates, but at every widget it resets x,y values. Intention was to treat window as a whole, without resetting coordinates when mousepointer hits a widget.
Widges uses window as first parameter.
Whats the approach for the above?
(think I read that windows needs focus for events to run, so thats not an option(?)
window = customtkinter.CTk() which holds several widges as (mapview,labels,combos....).
I use this function to get mouse x and y position, while mouse is moving:
It shows coordinates, but at every widget it resets x,y values. Intention was to treat window as a whole, without resetting coordinates when mousepointer hits a widget.
Widges uses window as first parameter.
Whats the approach for the above?
(think I read that windows needs focus for events to run, so thats not an option(?)
def motion(event): inp_posskjermx["text"] = f"{event.x}" inp_posskjermy["text"] = f"{event.y}" inp_posskjermx.configure(text=f"{event.x}") inp_posskjermy.configure(text=f"{event.y}") window.bind('<Motion>', motion)