-
- m_oldPos = fpos;
-
- m_adjust->lower = 0.0;
- m_adjust->upper = frange;
- m_adjust->value = fpos;
- m_adjust->step_increment = 1.0;
- m_adjust->page_increment = (float)(wxMax(fpage,0));
- m_adjust->page_size = fthumb;
-
- gtk_signal_emit_by_name( GTK_OBJECT(m_adjust), "changed" );
-}
-
-/* Backward compatibility */
-int wxScrollBar::GetValue() const
-{
- return GetThumbPosition();
-}
-
-void wxScrollBar::SetValue( int viewStart )
-{
- SetThumbPosition( viewStart );
-}
-
-void wxScrollBar::GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength ) const
-{
- int pos = (int)(m_adjust->value+0.5);
- int thumb = (int)(m_adjust->page_size+0.5);
- int page = (int)(m_adjust->page_increment+0.5);
- int range = (int)(m_adjust->upper+0.5);
-
- *viewStart = pos;
- *viewLength = range;
- *objectLength = thumb;
- *pageLength = page;
-}
-
-int wxScrollBar::GetViewLength() const
-{
- return (int)(m_adjust->upper+0.5);
-}
-
-int wxScrollBar::GetObjectLength() const
-{
- return (int)(m_adjust->page_size+0.5);
+ g_signal_handlers_block_by_func(m_widget, (void*)gtk_value_changed, this);
+ GtkRange* widget = GTK_RANGE(m_widget);
+ gtk_adjustment_set_page_size(gtk_range_get_adjustment(widget), thumbSize);
+ gtk_range_set_increments(widget, 1, pageSize);
+ gtk_range_set_range(widget, 0, range);
+ gtk_range_set_value(widget, position);
+ m_scrollPos[0] = gtk_range_get_value(widget);
+ g_signal_handlers_unblock_by_func(m_widget, (void*)gtk_value_changed, this);