From f20a4018f428350c80b9c60b051e4f7606b90415 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 7 Nov 2006 22:35:33 +0000 Subject: [PATCH] Keep m_pos in sync in SetValue in case the value_changed callback is 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gtk/slider.cpp b/src/gtk/slider.cpp index 5cde6b19f6..0a75a32c55 100644 --- a/src/gtk/slider.cpp +++ b/src/gtk/slider.cpp @@ -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)); + } } } -- 2.45.2