Xavier Larrode wrote:
Murray Cumming a �it :On Fri, 2007-02-16 at 11:58 +0100, Xavier Larrode wrote:Hi all,I have made a dialog with several spinButton, and i have a callback with the value_changed signal. My problem is that i only want that callback, when the user is using the spinButton and not when i set the value with set_value...Any idea how i can handle that ?In these situations, I use a boolean. For instance: ... m_dont_handle_spinbutton_signal = true; spin_button_set_value(...) m_dont_handle_spinbutton_signal = false;
Why not use a sigc::connection? Then you can just block and unblock it: spinbutton_value_changed_connection = spinbutton.signal_value_changed().connect(...); spinbutton_value_changed_connection.block(); spinbutton.set_value(...); spinbutton_value_changed_connection.unblock();