Re: problem handling "mouse button press"



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



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