I'm using this code to create a combo box with colored background/text:
GtkListStore *liststore;
GtkWidget *combo;
GtkCellRenderer *column;
liststore = gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING);
for(int i=0; i<10; i++) {
gtk_list_store_insert_with_values(liststore, NULL, -1, 0, "Default", 1, "white", 2, "black", -1);
}
combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(liststore));
g_object_unref(liststore);
column = gtk_cell_renderer_text_new();
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), column, TRUE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), column, "text", 0, "foreground", 1, "background", 2, NULL);
and it works. It looks like this:
My question is, how can I set the background of the liststore or the combo box so that there is no whitespace as seen in the picture? Thanks!