Hi,
I have a GtkSwitch, with a connected callback for the “state-set” signal.
In the callback function, I sometimes need to reverse the state of the switch, to indicate that something went wrong, and could not be switched on. And here is my problem: how can I set the state of the GtkSwitch from within the callback, with gtk_switch_set_active(), without triggering another call to the callback function?
I tried:
g_signal_handler_block(self, handler_id);
gtk_switch_set_active(self, state);
g_signal_handler_unblock(self, handler_id);
but, it doesn’t work. Probably, when the signal is emitted, it is already unblocked.
Thank you!