+ {
+ m_hAdjust->upper = (vw+m_xScrollPixelsPerLine-1) / m_xScrollPixelsPerLine;
+ m_hAdjust->page_size = w / m_xScrollPixelsPerLine;
+ m_hAdjust->page_increment = w / m_xScrollPixelsPerLine;
+
+ // Special case. When client and virtual size are very close but
+ // the client is big enough, kill scrollbar.
+
+ if ((m_hAdjust->page_size < m_hAdjust->upper) && (w >= vw))
+ m_hAdjust->page_size += 1.0;
+
+ // If the scrollbar hits the right side, move the window
+ // right to keep it from over extending.
+
+ if ((m_hAdjust->value != 0.0) && (m_hAdjust->value + m_hAdjust->page_size > m_hAdjust->upper))
+ {
+ m_hAdjust->value = m_hAdjust->upper - m_hAdjust->page_size;
+ if (m_hAdjust->value < 0.0)
+ m_hAdjust->value = 0.0;
+
+ if (GetChildren().GetCount() == 0)
+ m_xScrollPosition = (int)m_hAdjust->value; // This is enough without child windows
+ else
+ gtk_signal_emit_by_name( GTK_OBJECT(m_hAdjust), "value_changed" ); // Actually scroll window
+ }
+ }