help - gtk_scrolled_window_get_hadjustment



Hello,

I have a scrolled window, and want to scroll this within code, I've had a
look at the docs for gtk_scrolled_window_get_hadjustment & set_hadjustment
and this is what I've come up with...

gint CheckVal(GtkScrolledWindow *win) {
    GtkAdjustment *adj;
    adj = gtk_scrolled_window_get_hadjustment((GtkScrolledWindow *)win);
    printf("scrolledwin - lower %.2f  ", adj->lower);
    printf("upper %.2f  ", adj->upper);
    printf("value %.2f\n", adj->value);

    adj->value += 10;

    if(adj->value >= adj->upper) {
        adj->value = adj->lower;
    }
    gtk_scrolled_window_set_hadjustment((GtkScrolledWindow *)win, adj);

    return(TRUE);
}

The code is fired off from a gtk_timeout_add function and *does* appear to
be updating the value correctly, but the scroll bar doesn't move.

Am I doing something wrong, can this be done, or am I missing something???

Thanks in advance,
Mark.




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