You need to store the connection, and then disconnect when you are
reconnecting. Something like this:

/* somewhere in your class declaration, or any other appropriate place */

sigc::connection conn = spinbutton->signal_value_changed().connect(
sigc::mem_fun( *this, &YourClass::your_callback )) ;

/* when connecting again you disconnect this first */

conn.disconnect()


Hope my explanation is clear enough (but somehow I doubt it)

Cheers
M.

On Fri, Sep 2, 2011 at 7:34 PM, lecas malecas <[email protected]> wrote:

> Hey there!
>
> So, I have several Gtk::RadioButton in a group, and also a Gtk::SpinButton.
> The RadioButton's represent a number (from 1 to 4), and when I click
> in one of them the SpinButton's value is updated as well. For numbers
> above 4, I use the SpinButton, and the active  RadioButton is
> inactive.
>
> I attached the same event function to all of them, but I send a
> different value as the argument, to differentiate them.
>
> The problem is that when I click on a different SpinButton, that
> function is called two times (for the SpinButton that was set before,
> and for the one that is now), and when I use the SpinButton to change
> the value, its called three times!
>
> It actually works when changing from 1 to 4, but when I try to change
> the SpinButton value to something above 4, it doesn't work. It calls
> one time to set to 5, and immediately to 4 (since I called .set_active
> (false) on the RadioButton which triggers the event ahah :p).
>
> I probably can work around this situation, but I was wondering if
> there's a nice way to cancel these multiple event calls.
> _______________________________________________
> gtkmm-list mailing list
> [email protected]
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
>



-- 
Please note that according to the German law on data retention,
information on every electronic information exchange with me is
retained for a period of six months.
[Bitte beachten Sie, dass dem Gesetz zur Vorratsdatenspeicherung zufolge
jeder elektronische Kontakt mit mir sechs Monate lang gespeichert wird.]
_______________________________________________
gtkmm-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to