Suppress signal on Gtk.ToggleButton.set_active
Asked Answered
L

1

6

Is there a way to suppress the "toggled" signals that is emitted when you set the state of a ToggleButton with set_active()?

I want to represent a connection state with a GtkToggleButton. Since the state can change from other events than just clicking the button, I want to update the button on state-change signals, but I would like the signal not to be emitted (I don't need to run a disconnection procedure when it is already disconnected). I could just check the connection state, but it seems to be inconsistent around the time of the signal.

Other solutions than ToggleButtons are also welcome.

Thanks

Longer answered 17/7, 2012 at 10:5 Comment(0)
A
4

See object.handler_block() and friends.

Archimedes answered 17/7, 2012 at 13:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.