GtkComboBox again


Is there any way to add a separator in the GtkComboBox. I am using
combo box with a tree model. Also I need to add markup properties that
applies to a whole column. How do I do that? I tried the following
code, but it doesn't work.

ts = gtk_tree_store_new(1,G_TYPE_STRING);
GtkWidget *tv = gtk_tree_view_new_with_model(GTK_TREE_MODEL(ts));
GtkCellRenderer* cr = gtk_cell_renderer_text_new();
//g_object_set(G_OBJECT(cr),"weight",1000,NULL); //this works

g_object_set(G_OBJECT(cr),"markup","<span size=\"large\" weight =
\"bold\">some text</span>",NULL);

GtkTreeIter iter;
gtk_tree_store_insert(ts, &iter, NULL, 0);
gtk_tree_store_set(ts, &iter, 0, "FIRST",-1);

GtkWidget* combo = gtk_combo_box_entry_new_with_model(GTK_TREE_MODEL(ts),0);
gtk_cell_layout ...

One more problem that I had was with disabling of a particular entry
in the combo box which doesn't seem so easy. All these things were
accomplished quite easily with GtkOptionMenu which is now deprecated
in preference to GtkComboBox. But GtkComboBox doesn't seem to have any
easy ways to achieve the same. Why were things designed like this? or
am I missing something here? Can anyone point to some detailed
documentation on the net related to GtkComboBox or migrating from
GtkOptionMenu to GtkComboBox?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]