Re: Scroll horizontal GtkIconView with mouse wheel



Hi Damián,

2011/12/31 Damián Nohales <damiannohales gmail com>:
> That I want is to allow that the GtkIconView scroll horizontally with
> the mouse wheel. I can capture the event but I don't know how scroll the
> GtkIconView.

You need to get the horizontal adjustment of the scrolled window, move
the value by the step, and emit value_changed. Something like:

GtkAdjustment *hadj = gtk_scrolled_window_get_hadjustment (swin);
double step = gtk_adjustment_get_page_increment (hadj);
double value = gtk_adjustment_get_value (hadj);
value += step;  // depends on the scroll direction
gtk_adjustment_set_value(hadj, value);

It'd be nice if scrolledwindow handled horizontal scrolling for you,
there's probably a good reason why it doesn't.

John


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