0

How can I return in a GTK function in C a list of characters with GSList?

I need to save the path of each file contained in a folder This is my code: void on_file1_file_set(GtkFileChooserButton *chooser){ GSList filelist; printf("file name = %s\n", gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(chooser))); printf("folder uri = %s\n", gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(chooser))); printf("folder filenames = %s\n", gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(chooser))); return filelist; }

23rd Sep 2022, 3:10 PM
Fidel Alejandro Sanchez Fernandez
Fidel Alejandro Sanchez Fernandez - avatar
1 Answer
0
To do that you can follow these steps: - Create an empty GSList. - Iterate through the files in the folder. - For each file, append its path to the GSList. - Return the GSList containing the file paths.
19th Apr 2024, 8:21 PM
`ᎎᔗᔗዚ
`ᎎᔗᔗዚ - avatar