GtkAdjustment smooth scrolling



Hello,

I use a scrolled window in a program of mine, and I've noticed that if I
set the value of its adjustment "manually", the window is immediately
scrolled to the given position.  For example, with something like the
following code (where vadj is the vertical adjustment of the window):

gdouble current = gtk_adjustment_get_value(vadj);
gtk_adjustment_set_value(vadj,
	CLAMP(current + vadj->page_increment, vadj->lower, vadj->upper));

The scrolled window appears at the given area instantly.  If I just use
the Page Down key, however, the scrolling is smooth, gradual.  I have no
real preference to either behaviour -- what I don't like is the
inconsistency.

I glanced through the source for GtkAdjustment and GtkScrolledWindow, but
nothing jumped out at me as being the implementation of the smooth
scrolling.  Could someone here help me out or point me in the right
direction?

Thanks,

Stephen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]