Re: Drawing Area and Mouse Events



On Thu, Jun 10, 2004 at 03:15:59PM +0100, JOSE PEDRO SERGIO ROMAO MACHADO wrote:

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.

I think this kind of feature is not suported by GTK 
itself. I'm I correct???

Just add mouse click event with

  gtk_widget_add_event(widget, GDK_BUTTON_PRESS_MASK);

and you can then connect to "button_press_event" signal of
the widget.

Yeti


--
Do not use tab characters. Their effect is not predictable.



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