From 02a5e3341da91e2ce69a3e9e0387c559aa83cbdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sat, 23 Feb 2013 20:35:14 +0000 Subject: [PATCH] [GB.GTK] * BUG: Scrollbar and Slider correctly raise their Change event when their Value property is set manually. git-svn-id: svn://localhost/gambas/trunk@5559 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.gtk/src/gslider.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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)); }