Re: problem handling "mouse button press"



Actually, i found that the eventbox has the button_press and
button_release masks set as default.

The next problem is this will catch the button press anywhere on the
pixmap.

Simon

On Mon, 2002-03-18 at 13:51, Havoc Pennington wrote:

Gregory Babusiaux <gbabusia ulb ac be> writes:

i got a pixmap on my main window and i would like to catch the
button press event on this pixmap

to create my pixmap i use the function gtk_create_pixmap_from_xpm
and my main window only contains my pixmap

i tried the function gtk_signal_connect(pixmap,
"button_press_event", cllaback, NULL) but it doesn't work???


Pixmaps are "no window" widget so don't get events.
Create a GtkEventBox, place the pixmap inside that,
then connect your callback to the event box. You need to
gtk_widget_set_events() or gtk_widget_add_events()
GDK_BUTTON_PRESS_MASK on the event box.

Havoc
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list






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