X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fui.c;h=988561b557d7c2390bea8ad640fe5b3d7e26a9c0;hb=ee9061a5a0c2551a337d809c7040ec5790b10e0d;hp=c8912dbc7bbbb97df28eb1a2a76e6d4ef07a9a8d;hpb=1bbcc24cd35fbfc8e87abd7d6e5df7e70b411971;p=melted_gui diff --git a/src/ui.c b/src/ui.c index c8912db..988561b 100644 --- a/src/ui.c +++ b/src/ui.c @@ -131,6 +131,7 @@ static GtkWidget* create_treeview(GtkWidget* top, char* name, const column_desc_ treeview = gtk_tree_view_new (); gtk_widget_show (treeview); + gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), TRUE); selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE); @@ -138,14 +139,17 @@ static GtkWidget* create_treeview(GtkWidget* top, char* name, const column_desc_ for(i = 0, count = 0; columns[i].title; i++, count++) list_store_types[i] = (columns[i].type == G_TYPE_OBJECT)?GDK_TYPE_PIXBUF:columns[i].type; list_store_types[count] = G_TYPE_INT; + list_store_types[count + 1] = G_TYPE_BOOLEAN; + list_store_types[count + 2] = G_TYPE_STRING; - list_store = gtk_list_store_newv(count + 1, list_store_types); + list_store = gtk_list_store_newv(count + 3, list_store_types); gtk_tree_view_set_model( GTK_TREE_VIEW( treeview ), GTK_TREE_MODEL( list_store ) ); for(i = 0; columns[i].title; i++) { char* prop; + column = NULL; if(columns[i].type == G_TYPE_OBJECT) { @@ -162,10 +166,21 @@ static GtkWidget* create_treeview(GtkWidget* top, char* name, const column_desc_ { renderer = gtk_cell_renderer_text_new(); prop = "text"; + + column = gtk_tree_view_column_new_with_attributes( + columns[i].title, renderer, + prop, i, + "background-set", count + 1, + "background", count + 2, + NULL); } - column = gtk_tree_view_column_new_with_attributes( - columns[i].title, renderer, prop, i, NULL); + if(!column) + column = gtk_tree_view_column_new_with_attributes( + columns[i].title, renderer, + prop, i, + NULL); + gtk_tree_view_append_column(GTK_TREE_VIEW( treeview ), column); };