simple problem



Hello,

I'm fighting against elements to get a gtk+-2-based program working.
I've read some interesting sections in the doc, and I tried to catch a
mouse button event on a drawing area, created with gtk_drawing_area_new().

This should be very simple.

Well, I used gtk_widget_add_events() with GDK_BUTTON_PRESS_MASK, and set
up a callback which prints event->x and event->y.

You say: "Cool, but what's your problem then ?"

The problem is that the values are absolutely wrong.
I _always_ get X=0 and Y=some_huge_value (like 1078951936).

I wrote a very tiny program (50 lines) where the the problem occurs, and I
put the source file here:
http://icculus.org/~phneutre/test_gtk2.c

I must be doing something wrong, but I can't see what (as usual).

Thanks in advance,
clement.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]