5

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

4

1 回答 1

3

See object.handler_block() and friends.

于 2012-07-17T13:56:43.097 回答