[gcompris-devel] GooCanvas get pointer position?

Peter Albrecht pa-dev at gmx.de
Fri Sep 21 20:32:28 UTC 2012


Hi!

I would like to know the position of the mouse pointer on
the screen in GCompris' 800x520 coordinate space. Does
anyone know, how to optain this?

When called as a "motion_notify_event", I get the desired
values from event.x_root / event.y_root.

But in my case, I have no event.

Best, I could come up with is:
#  x, y = self.rootitem.get_canvas().get_pointer()

But this gives me the mouse coordinates in screen resolution
(1680x1050 in my case).

Any ideas?

Regards,
	Peter




More information about the Gcompris-devel mailing list