Problem with gtk_tree_selection_select_path: background color does not change

View: New views
2 Messages — Rating Filter:   Alert me  

Problem with gtk_tree_selection_select_path: background color does not change

by Carlos Pereira-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi list,
I need to select multiple rows in a treeview,
directly from my code, in MULTIPLE selection mode.
This is a very simple treemodel, only one column
with a string.

Unfortunately, although gtk_tree_selection_select_path()
seems to select the indicated rows, the background color
of the rows do not change.

For example, running this code:
path = gtk_tree_path_new_from_string ("1");
gtk_tree_selection_select_path (selection, path);
path = gtk_tree_path_new_from_string ("3");
gtk_tree_selection_select_path (selection, path);

and then:
gtk_tree_selection_selected_foreach (selection,
static_foreach_list, data);

shows that the second (1) and fourt (3) rows have indeed
been selected, but the background color remains unchanged...

So my question is: how can I force GTK to change the
background color of the selected rows?

Many thanks for your help, I searched the archives for
this mailling list, I did see this question posted, but
not a working answer... the same for the web...

Carlos

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@...
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

SOLVED: Re: Problem with gtk_tree_selection_select_path: background color does not change

by Carlos Pereira-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is nicely working for me now, I should have been doing something
wrong before,
Carlos

> Hi list,
> I need to select multiple rows in a treeview,
> directly from my code, in MULTIPLE selection mode.
> This is a very simple treemodel, only one column
> with a string.
>
> Unfortunately, although gtk_tree_selection_select_path()
> seems to select the indicated rows, the background color
> of the rows do not change.
>
> For example, running this code:
> path = gtk_tree_path_new_from_string ("1");
> gtk_tree_selection_select_path (selection, path);
> path = gtk_tree_path_new_from_string ("3");
> gtk_tree_selection_select_path (selection, path);
>
> and then:
> gtk_tree_selection_selected_foreach (selection,
> static_foreach_list, data);
>
> shows that the second (1) and fourt (3) rows have indeed
> been selected, but the background color remains unchanged...
>
> So my question is: how can I force GTK to change the background color
> of the selected rows?
>
> Many thanks for your help, I searched the archives for
> this mailling list, I did see this question posted, but
> not a working answer... the same for the web...
>
> Carlos
>
>

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@...
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list