Am 28.05.2021 um 20:46 schrieb Allin Cottrell:
On Fri, 28 May 2021, Sven Schreiber wrote:
> The question is, how is it possible to specify one pattern which covers
> two file extensions (*.zip and *.gfn) ? The doc just says use a glob,
> but what exactly is supported there? Would curly braces be expected to
> work to denote multiple patterns, like this: {*.zip,*.gfn}
Not sure about that -- in fact I doubt it, a glob is not a regular
expression -- but what I had in mind is to add two patterns to the one
filter, as in
GtkFileFilter *filt = gtk_file_filter_new();
gtk_file_filter_set_name(filt, _(desc));
gtk_file_filter_add_pattern(filt, pat1);
gtk_file_filter_add_pattern(filt, pat2);
gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(filesel), filt);
where desc is the description, pat1 would be "*.gfn", and pat2 would
be "*.zip".
Hm, I thought that would just create the two to-choose-from filters, but
I see that perhaps the hierarchy of what the "filter" entity is has
different semantics. Hopefully I can experiment with that a little.
But for questions and issues like these, is there a web location to
which you would point people, where the nesting or internal structure of
the gtk widgets is explained? (Because the developer reference I quoted
before does not do that.)
thanks
sven