Re: Drawing Area and Mouse Events



JOSE PEDRO SERGIO ROMAO MACHADO wrote:
Hi there!

I'm using gtk_window_new() and gtk_drawing_area_new() functions to draw some pixbufs over a background.

Now I need to "click" with the mouse over this drawing area, and I need to obtain the coordinates of the mouse pointer at that spot to decide wich callback should I call.

"button-press-event" of GtkDrawingArea cast to GtkWidget:

gboolean user_function(GtkWidget *widget,
                       GdkEventButton *event,
                       gpointer user_data);

Register for button-press events with gtk_widget_add_events().



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