Re: Forcing GtkScrolledWindow to sroll



On Mon, Jan 11, 2010 at 01:51:06PM -0500, Tim Corio wrote:
I couldn't find this in the archives, but I assume it's a common thing.

How do I force a GtkScrolledWindow to scroll?

You can either use gtk_range_set_value() on the scrollbar obtained with
gtk_scrolled_window_get_hscrollbar()/gtk_scrolled_window_get_vscrollbar()
or gtk_adjustment_set_value() on the adjustments obtained by similar
functions.

Using the C API, I have a drawing area widget that I put into a scrolled
window.  I can scroll the image as expected by dragging the scrollbars.
Now, I want to first, force the viewport to be scrolled to the center of
the image.  The I want to implement a "drag" scrolling.  The user will
click and drag the image to make it scroll.

Generally, you don't want to do this because it is inefficient if the
image is large.  Do not allocate a larger drawing area than the visible
part, do not use a viewport and, instead, just draw the visible part of
the image according to the scrollbar positions in the expose event.

Yeti




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