在运行的应用程序中,我要替换的内容 一个“ GTK_COMBO_BOX_TEXT ....”
我愿意
void initLoadComboBox() {
struct passwd *pw = getpwuid(getuid());
const char *homedir = pw->pw_dir;
GtkTreeModel *tm = gtk_combo_box_get_model(GTK_COMBO_BOX(loadComboBox));
gtk_list_store_clear(GTK_LIST_STORE(tm));
DIR* dirp = opendir(homedir);
struct dirent * dp;
while ((dp = readdir(dirp)) != NULL) {
if (strncmp("tkbrain-", dp->d_name, 8) == 0) {
char *xy = new char[1000];
strcpy(xy, dp->d_name);
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(loadComboBox),
xy);
}
}
closedir(dirp);
}
gtk_combo_box_text_remove_all()
的相同问题