void ok_clicked(GtkWidget *widget, gpointer data) { GtkIconFileSel *filesel; const gchar *path; const gchar *file; const gchar *selection; filesel = GTK_ICON_FILESEL(data); path = gtk_file_list_get_path(GTK_FILE_LIST(filesel->file_list)); file = gtk_file_list_get_filename(GTK_FILE_LIST(filesel->file_list)); selection = gtk_icon_file_selection_get_selection(filesel); if(path) printf("PATH: %s\n",path); if(file) printf("FILE: %s\n",file); if(selection) printf("SELECTION: %s\n",selection); if(GTK_ICON_LIST(filesel->file_list)->selection_mode == GTK_SELECTION_MULTIPLE){ GList *list; list = GTK_ICON_LIST(filesel->file_list)->selection; while(list){ gchar *text = ((GtkIconListItem *)list->data)->entry_label; if(text) printf("ICON %s\n",text); list = list->next; } } }
void ok_clicked(GtkWidget *widget, gpointer data) { GtkIconFileSel *filesel; const gchar *path; const gchar *file; const gchar *selection; filesel = GTK_ICON_FILESEL(data); path = gtk_file_list_get_path(GTK_FILE_LIST(filesel->file_list)); file = gtk_file_list_get_filename(GTK_FILE_LIST(filesel->file_list)); selection = gtk_icon_file_selection_get_selection(filesel); if(path) printf("PATH: %s\n",path); if(file) printf("FILE: %s\n",file); if(selection) printf("SELECTION: %s\n",selection); }