Re: Auto-scrolling up or down a GtkScrolledWindow



Hi,

first, there seems to be some information missing from your question. namely, what type of widget is the child the scrolled window is holding?

because, your positioning requirement is a requirement for the child, not the scrolled window, the scrolled window simply acts as a helper container for child widgets without native scrolling support, in that the scrolled window does not have access to modifying the display position of the child's contents.

for example, if the child widget is a TreeView (columns of data), you can achieve what you are trying to do with the following calls:

char	row_num[5] = "100";
GtkTreePath	*path = gtk_tree_path_new_from_string(row_num)
gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW (hdrVIEW), path, NULL, TRUE, 0.0, 0.0);
gtk_tree_view_set_cursor(GTK_TREE_VIEW (hdrVIEW), path, NULL, FALSE);

see the documentation for GtkTreeView for further details. or, alternatively, see the documentation for the child widget relevant for your scenario and available support for positioning its contents.

cheers,

richard

On Mar 28, 2006, at 8:58 PM, Meli Vázquez wrote:

Hi again guys.

I have a GtkScrolledWindow which contents I refresh periodically. I
would like it to scroll down each time I update its contents.

I've tried something like this:

VScrollBarPos = gtk_scrolled_window_get_vadjustment (..);
VScrollBarPos->value--; (or value++)

each time I write in it. But it doesn't seem to work. The scroll
window doesn't scroll down (though I can still do it manually).

I also tryied with combinations of:
- gtk_scrolled_window_set_vadjustment(..)
- gtk_adjustment_set_value        (..)

But still doesn't work.

When debugging I saw that upper and lower bounds don't change (though
I still can scroll up and down manually in the GUI).

What am I doing wrong? Why isn't it working?


Thanks again in advance.
AV.
_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list






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