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
This commit is contained in:
Robin Dunn
2006-11-07 22:35:33 +00:00
parent 4f13d3825e
commit f20a4018f4

View 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));
}
}
}