I’m working with gtk+-2.0.8 on FreeBSD 4.7-STABLE (noticed this
in gtk+-2.0.7 as well, though). The signals ‘enter’ and ‘leave’ work as
expected for mouse movement over the button, but the unexpected behavior is
when a GtkButton is pressed. If you create a program and use g_signal_connect () to attach to of the signals, for each
click of the button, the signals are emitted in the following order: leave enter pressed clicked released Why are the signals ‘leave’ and
‘enter’ emitted when the mouse has not left the button? Using the keyboard to click the button emits the ‘activate’
and ‘clicked’ signals, but not the ‘pressed’ or
‘released’ signals, so I’m assuming these are
“mouse-only” signals just as ‘enter’ and
‘leave’ are. As a side note: if I edit the gtkbutton.c
file directly and put my printf() statements in the gtk_button_[pressed/released/enter/leave/clicked]
functions responsible for signal emission, I get the following result: leave enter pressed released clicked Changing the signals from GTK_RUN_FIRST to GTK_RUN_LAST makes the
attached signal handler output consistent with that of the embedded printf()
output (i.e. the ‘clicked’ signal is always emitted after the
‘released’ signal). Regards, T.C. |