Re: tree view question / hightlighting rows



Alexander Nagel wrote:
Hi,

i have a treeview which displays a list of filenames in one column and other things in other columns. I can iterate successfully through the list. How can I highlight the current row? With "highlight" I mean that the row looks like selected by the user.
For example, this code selects the first row, exactly as if the user had clicked with the mouse:

GtkWidget *treeview;
GtkTreeSelection *selection;
GtkTreeModel *model;
GtkTreeIter iter;

selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview));
gtk_tree_model_get_iter_first (model, &iter);
gtk_tree_selection_select_iter (selection, &iter);
My next question/problem then is: if the list is longer than the current scrolledwindow, how can I autoscroll the hightlighted row is always visible to the user?
Hope you understand what I mean.
I am almost sure this was already discussed (several times) in this list... did you look into the arquives?
Carlos
bye
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





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