Ok . I was successful with it. Instead I use GtkListstore, I used GtkTreestore, and it worked.
This is my code:
Quote:
/* create combo box*/
ts = gtk_tree_store_new(1, G_TYPE_STRING);
cr = gtk_cell_renderer_text_new();
g_object_set (G_OBJECT(cr), "font", FONT_DESC_LEVEL_3, NULL );
gtk_tree_store_clear (ts);
gtk_tree_store_insert(ts, &iter, NULL, 0);
gtk_tree_store_set(ts, &iter, 0, "Just line", -1);
gtk_tree_store_insert(ts, &iter, NULL, 0);
gtk_tree_store_set(ts, &iter, 0, "Just marker", -1);
gtk_tree_store_insert(ts, &iter, NULL, 0);
gtk_tree_store_set(ts, &iter, 0, "Both", -1);
result->combo_render_style = gtk_combo_box_new_with_model(GTK_TREE_MODEL(ts));
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(result->combo_render_style),cr,FALSE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(result->combo_render_style),cr,"text",0,NULL);
Note that when I use the same code with GtkListstore rather than GtkTreestore, it show 2 columns of item text. I also don't know why.
If anyone has answer for this, it's appreciated.