+
+ GtkAdjustment* adj = range->adjustment;
+ adj->step_increment = 1;
+ adj->page_increment =
+ adj->page_size = page_size;
+ gtk_range_set_range(range, 0, upper);
+
+ // ensure that the scroll position is always in valid range
+ if (*pos > *lines)
+ *pos = *lines;