]> git.saurik.com Git - wxWidgets.git/commitdiff
Keep m_pos in sync in SetValue in case the value_changed callback is
authorRobin Dunn <robin@alldunn.com>
Tue, 7 Nov 2006 22:35:33 +0000 (22:35 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 7 Nov 2006 22:35:33 +0000 (22:35 +0000)
not called, such as when the widget is first created.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/slider.cpp

index 5cde6b19f657a5f6289e381b427b04937c5e9346..0a75a32c556ea8d2781a649f99ef71266a552101 100644 (file)
@@ -346,6 +346,13 @@ void wxSlider::SetValue( int value )
         BlockScrollEvent();
         gtk_range_set_value(GTK_RANGE (m_widget), value);
         UnblockScrollEvent();
+
+        // keep m_pos in sync in case the value_changed callback didn't didn't
+        // get called, such as when the widget is first created
+        if (GetValue() != value)
+        {
+            m_pos = gtk_range_get_value(GTK_RANGE(m_widget));
+        }
     }
 }