-1

I am looking for a function in GTK+ that can tell me the coordinates of the cursor (x,y) also that works with Linux operating systems.

Any answer is greatly appreciated.

1 Answers1

0

A quick check of the documentation turned up gdk_window_get_device_position(), which should work even outside mouse events. (I have not tried it myself.) The caveat here is that this is for GDK windows, not what most people think of as windows (i.e. GTK+ windows). One path from a GTK+ widget to a GDK window is gtk_widget_get_window().

As for working on Linux, GTK+ is designed to be cross-platform, so everything should work on Linux unless specifically documented otherwise.

JaMiT
  • 14,422
  • 4
  • 15
  • 31