Не могу изменить цвет текста в таблице. Делаю так:
enum{COLUMN_NAME, COLUMN_VARIABLE, N_COLUMNS, COLORTEXT};
...
GdkRGBA color= {0.0, 0.5, 0.9, 0.5};
GtkWidget *tree;
GtkTreeStore *store;
GtkTreeIter iter, citer;
GtkCellRenderer *renderer;
GtkTreeViewColumn *column;
tree = gtk_tree_view_new();
store = gtk_tree_store_new(N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
gtk_tree_view_set_model(GTK_TREE_VIEW(tree), GTK_TREE_MODEL(store));
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes ("Item", renderer, "text", COLUMN_NAME, "foreground-rgba", COLORTEXT, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes ("Num", renderer, "text", COLUMN_VARIABLE, "foreground-rgba", COLORTEXT, NULL);
gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
gchar i[]={"hello"};
gtk_tree_store_append(store, &iter, NULL);
gtk_tree_store_set(store, &iter, COLUMN_NAME, "Центральный процессор", COLUMN_VARIABLE, "lala", COLORTEXT, color, -1);
gtk_tree_store_append(store, &citer, &iter);
gtk_tree_store_set(store, &citer, COLUMN_NAME, "apple", COLUMN_VARIABLE, &i, COLORTEXT, color, -1);
...
При запуске
(hello:11715): Gtk-WARNING **: /build/buildd/gtk+3.0-3.14.12/./gtk/gtktreestore.c:1042: Invalid column number 3 added to iter (remember to end your list of columns with a -1)
(hello:11715): Gtk-WARNING **: /build/buildd/gtk+3.0-3.14.12/./gtk/gtktreestore.c:1042: Invalid column number 3 added to iter (remember to end your list of columns with a -1)
(hello:11715): Gtk-CRITICAL **: gtk_tree_store_get_value: assertion 'column < priv->n_columns' failed
(hello:11715): GLib-GObject-CRITICAL **: g_object_set_property: assertion 'G_IS_VALUE (value)' failed