Re: How to stop signal in the folowing case?
- From: Paul Davis <paul linuxaudiosystems com>
- To: "Peter T. Mayer" <peter_t_mayer yahoo de>
- Cc: gtk-list gnome org
- Subject: Re: How to stop signal in the folowing case?
- Date: Tue, 11 May 2004 09:01:09 -0400
>Hello,
>
>Lets assume we have two spinbuttons (spinbutton_A and spinbutton_B), if
>I change one of the spinbuttons the callback functions:
>
>void on_spinbutton_A_changed (GtkEditable *editable, gpointer user_data) {
> gtk_spin_button_set_value( spinbutton_B, MY_VALUE );
>}
>
>void on_spinbutton_B_changed (GtkEditable *editable, gpointer user_data) {
> gtk_spin_button_set_value( spinbutton_A, MY_VALUE );
>}
>
>are called, now as you can see, this is an never ending recursion. When
>I change spinbutton_A, spinbutton_B is changed too and so his callback
>function is called and so spinbutton_A is changed ...
this doesn't cause never ending recursion if MY_VALUE is a single
value. gtk_spin_button_set_value (foo, val) does nothing if "val" is
equal to the current value.
this is a classic problem for Model-View-Controller programming, and
blocking the signal is not normally the right way to deal with it.
how do you compute MY_VALUE?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]