How to set the state of GtkSwitch without triggering the state-set signal handler

I have an update_ui function which has to set the state of the switch but without triggering the signal handler which will call update_ui leading to a stack overflow.

Alternatively, how do i listen to clicks on the switch without using the state-set signal. The docs say that applications should not connect to the “activate” signal.

I fixed it for now by using a flag in the signal handler, but it feels kinda hacky.

You might want to change Gtk.Switch:active instead.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.