SpinButton: how to avoid calling signal handler when set_value()

2016-11-01 Thread pozzugno
I have a SpinButton with an associated Adjustment. I connected a handler for "value-changed" signal, because I have to make something when the user changes the value. I sometimes need to change the value in the code, using set_value() method of SpinButton or Adjustment. In this case, I don't wa

Re: SpinButton: how to avoid calling signal handler when set_value()

2016-11-01 Thread Chris Moller
Have you tried g_signal_handler_block (gpointer instance, gulong handler_id); and g_signal_handler_unblock (gpointer instance, gulong handler_id); Putting these before and after your set_value() should temporarily block the handler. You get the handler_id from g_signal_connect(...): handle

Re: SpinButton: how to avoid calling signal handler when set_value()

2016-11-01 Thread pozzugno
I already thought of blocking handlers during refresh, but it means adding two instructions (_block and _unblock) for each set_value(). A simple and clear sequence of instructions: _set_value() _set_value() .. will be transformed in a complex, long and cryptic sequence of instructions:

Re: SpinButton: how to avoid calling signal handler when set_value()

2016-11-01 Thread Nicola Fontana
Il Wed, 2 Nov 2016 00:09:29 +0100 pozzugno scrisse: > ... > A simple and clear sequence of instructions: > >_set_value() >_set_value() >.. > > will be transformed in a complex, long and cryptic sequence of > instructions: > >_block() >_set_value() >_unblock() >_blo