Re: cancelling/aborting an emitted signal

>Do you know a) will the gtk_toggle_button_get_active() still work as
>expected in the new handler and b) will calling

the "new" handler won't change the behaviour of
gtk_toggle_button_get_active().  if the button is toggled, this
function will return TRUE, and FALSE otherwise. 

what the handler will do is to affect the effect of a button
press/release. if it returns TRUE *and* calls
gtk_signal_emit_stop_by_name(), the button press will have no action
at all - the button will not enter the toggled state at all.

>gtk_signal_emit_stop_by_name for the "button_press_event" actually
>cancel the signal and revert the toggle button to its original state?

it doesn't revert it, it stops the toggle from even occuring.

>Also, do I have to setup identical signal handlers for using the
>keyboard, i.e. "key_press_event" since I am not using the

you may well have to do that, since GTK+ by default has key bindings
that will toggle the button.


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