oo... "best" is always a loaded term and open to opinion.
You can pass structures to callbacks but not back from callbacks.
The solution; however, is very simple. Use a global variable. Any data declared outside of a function will be available for all the functions following it. Using global variables is generally more efficient than local variables, they just have a habit of making your code a bit messy and may lead to bugs if not used correctly; which is why people prefer to do things local.
Now the trouble with your code is that you don't know how big to allocate this structure until the callback finds out how many files are selected and thus can't create your Pathlist as an array except in making it really big and just hope it doesn't overflow. This is the problem with static memory. Fortunately you have at your finger tips a number of freely expandable data types that use dynamic memory (you are already using one, the gslist). In fact all you have to do is declare FileList at the top of your code and you can use it anywhere.
As an alternative example, let's say you want to transfer your data to the more compact GArray (at least I think its more compact). Declare your GArray as a global variable, then append each PathList element into it. In fact because of the nature of the data type you will only need the filename (it is ordered and keeps track of its length - as does gslist). Here's an example (I've rejigged the iterator to be a bit more efficient):
Code:
GArray* gb_pla;
void cb(...)
{
gchar* str;
GSList* list;
...
list=gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(filechooserdialog));
while (list)
{
str=g_str_dup((gchar*) (list->data));
g_array_append_val(gb_pla, str);
g_free(str);
list=list->next;
}
...
}
...
int main(...)
{
gb_pla=g_array_sized_new(FALSE, FALSE,sizeof(gchar*),0);
...
gtk_main();
g_array_free(gb_pla);
}
Keep in mind that with memory management you should free up your data when done with it (I think I should be including steps to free list as I go in the code above, but I'm in a lazy mood today).