tags:

views:

25

answers:

2

In GTK I can't figure out what callback to setup so that when the user clicks in a window, I can get the X/Y co-ords of the click.

+1  A: 

The event param in the call back usually get's a x and a y member which are the mouse coordinates. If you need an example have a look at the gtk tutorial, there is the example code of a small drawing program, where you can see how to handle mouse events

http://www.gtk.org/tutorial1.2/gtk_tut-23.html

Nikolaus Gradwohl
I think the question was about _which_ signal to connect to. Also, that's a >10 year old version of the tutorial. Here is the latest: http://library.gnome.org/devel/gtk-tutorial/stable/c2422.html
ptomato
A: 

You're looking for the button-press-event signal of GtkWidget.

ptomato