Hi,
I now it’s a bad idea, to hardcode specific colors in the program.
But I would like to show a treeview with inventory for stocks. When 0 it should be the color red, when >0 green.
I’ve googled a lot, and it seems a bit tricky.
Does anyone know how to do it with the gtk_tree_store_set command, or is it not possibly?
The code i use to fill the treeview with 3 rows and 2 columns is like this:
Column 1 is Inventory_number, column 2 i number_of_item in stock.
gtk_tree_store_append (treeStore, &iter, NULL);
gtk_tree_store_set(treeStore, &iter, 0, "5000", -1);
gtk_tree_store_set(treeStore, &iter, 1, "35", -1); // should be green color
gtk_tree_store_append (treeStore, &iter, NULL);
gtk_tree_store_set(treeStore, &iter, 0, "5001", -1);
gtk_tree_store_set(treeStore, &iter, 1, "0", -1); // should be red color
gtk_tree_store_append (treeStore, &iter, NULL);
gtk_tree_store_set(treeStore, &iter, 0, "5002", -1);
gtk_tree_store_set(treeStore, &iter, 1, "12", -1); // should be green color
BR Thomas