<-----Messaggio Originale-----> >From: [EMAIL PROTECTED] >Sent: 30/8/2006 12:20:12 PM >gtk-app-devel-list@gnome.org >Subject: Re: help on scrollbars > ><-----Messaggio Originale-----> >>From: Paul Pogonyshev >>Sent: 29/8/2006 8:25:05 PM >>To: gtk-app-devel-list@gnome.org >>Cc: [EMAIL PROTECTED] >>Subject: Re: help on scrollbars >> >>[EMAIL PROTECTED] wrote: >>> Hi, >>> I'm working on an app and I'm facing the need to access the >>> button at the end of a vertical scrollbar of a scrolled window >>> to do something like a >>> >>> gtk_button_clicked() >>> >>> to ensure that the widget (a treeview) contained in it >>> gets scrolled to the end with whatever screen resolution >>> is used. >> >>Untested. This might help: >> >>gtk_adjustment_set_value (gtk_scrolled_window_get_adjustment >(scrolled_window), >> DBL_MAX); >> >>where `scrolled_window' contains the tree, of course. Actually >>`DBL_MAX' can be replaced with any large enough value, like >>1e100, if you don't want to include `float.h'. >> >>Paul >>. >> > >I've tried this already but it doesn't work as expected. >What I get is: >1) I add a row to the treeview and call the function you suggested or >similar >2) the slider of the scrollbar correctly slides to the end >3) the rebounds to the middle of his range > >I'm thinking about posting some example code >so that this is reproducible for others...... > >TIA and Ciao, >Tito > Hi, in the hope it could be useful to others this is what solved my problem about gtktreeview autoscrolling when a new row is added:
void list_vertical_autoscroll(GtkWidget *list) { GtkTreePath *path; GtkTreeIter iter; GtkTreeModel* model; model = gtk_tree_view_get_model(GTK_TREE_VIEW(list)); path = gtk_tree_model_get_path(GTK_TREE_MODEL(model), &iter); gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(list), path, NULL, TRUE, 0.0, 0.0); gtk_tree_path_free(path); } Thanks and Ciao, Tito <P><p><font face="Arial, Helvetica, sans-serif" size="2" style="font-size:13.5px">_______________________________________________________________<BR><BODY> <BR> Milioni di oggetti, impossibile non trovare quello che cerchi.<BR> Dallo spillo all'elefante, non ti stupire.<BR> Sei su <a href="http://adfarm.mediaplex.com/ad/ck/724-25726-1029-36?id=1">eBay!</a> </BODY> </font> _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list