-
- 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);
+ GtkAdjustment* adj = ((GtkRange*)m_widget)->adjustment;
+ adj->step_increment = 1;
+ adj->page_increment = pageSize;
+ adj->page_size = thumbSize;
+ adj->value = position;
+ g_signal_handlers_block_by_func(m_widget, (void*)gtk_value_changed, this);
+ gtk_range_set_range((GtkRange*)m_widget, 0, range);
+ m_scrollPos[0] = adj->value;
+ g_signal_handlers_unblock_by_func(m_widget, (void*)gtk_value_changed, this);