tags:

views:

145

answers:

0

Hi All,

I am using a event box(GtkeventBox) and on top of that I am adding a button image(GtkImage). I am connecting "enter-notify-event", "leave-notify-event", "button-release-event","button-press-event", to Event box.

Problem is that when I click(Mouse button down) on event box and drag mouse out side Event box area and releasing mouse button(Mouse button Up). In this case I am getting "button-release-event" on Event box. Logically event box should not receive "button-release-event" when mouse pointer is outside of event box area.

Why this is happening? Is any one have any clue or idea?

This is the relevant code I am using.

// Attach Events to Evtn/Image Button.
GtkWidget *eventbox_sign_in;
eventbox_sign_in = GTK_WIDGET( gtk_builder_get_object( builder, "eventbox_sign_in") );

GtkWidget *image_sign_in;
image_sign_in = GTK_WIDGET( gtk_builder_get_object( builder, "image_sign_in") );
gtk_image_set_from_file( GTK_IMAGE(image_sign_in), "button_normal.png");

//g_signal_connect(eventbox_sign_in, "expose-event", G_CALLBACK(on_eventbox_sign_in_expose_event), NULL);
g_signal_connect(eventbox_sign_in, "enter-notify-event", G_CALLBACK(on_eventbox_enter_notify_event), NULL);
g_signal_connect(eventbox_sign_in, "leave-notify-event", G_CALLBACK(on_eventbox_leave_notify_event), NULL);
g_signal_connect(eventbox_sign_in, "button-release-event", G_CALLBACK(on_eventbox_button_release_event), NULL);
g_signal_connect(eventbox_sign_in, "button-press-event", G_CALLBACK(on_eventbox_button_press_event), NULL);

Thanks,
KBalar