diff --git a/gb.gtk/src/gslider.cpp b/gb.gtk/src/gslider.cpp index 4ce304a4f..f11132d85 100644 --- a/gb.gtk/src/gslider.cpp +++ b/gb.gtk/src/gslider.cpp @@ -29,11 +29,11 @@ static void cb_change(GtkRange *range,gSlider *data) { int new_value = gtk_range_get_value(GTK_RANGE(data->widget)); + if (data->_value == new_value) return; data->_value = new_value; - //fprintf(stderr, "value = %d\n", data->_value); if (data->onChange) data->onChange(data); } @@ -222,8 +222,13 @@ void gSlider::setValue(int vl) else if (vl > _max) vl = _max; + if (_value == vl) + return; + _value = vl; init(); + + emit(SIGNAL(onChange)); }