Showing posts with label mouse. Show all posts
Showing posts with label mouse. Show all posts

Tuesday, December 2, 2008

Getting coordinates of cursor in GTK

The codes are simple, but we need to get the variables out of its static context.

gint x, y;
gdk_window_get_pointer(window->window, &x, &y, 0);
printf("My cords are: x %d and y: %d", x, y);

Viola!