我遵循了用项目填充我的组合框的代码:aaaa
, bbbb
, .... :
GtkWidget *combo_screen_share;
GtkListStore *store;
GtkTreeIter iter;
combo_screen_share=app_gtk_get_widget(/* .... */);
GtkTreeModel *model;
GtkCellRenderer *renderer=gtk_cell_renderer_text_new();
model=GTK_TREE_MODEL((store=gtk_list_store_new(1,G_TYPE_STRING)));
gtk_combo_box_set_model(GTK_COMBO_BOX(combo_screen_share),model);
gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo_screen_share),renderer,TRUE);
gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo_screen_share),renderer,"text",0,NULL);
gtk_list_store_append(store,&iter);
gtk_list_store_set(store,&iter,0,_("aaaa"),-1);
gtk_list_store_append(store,&iter);
gtk_list_store_set(store,&iter,0,_("bbbb"),-1);
// and so on....
如何调用“clearAll”从组合中删除所有项目,
我想重新 model
创建gtk_list_store_new
但改为:
aaaa aaaa
bbbb bbbb
谢谢,