GtkFileChooser and set_filter after set_file



Hi,

how can I set the active FileFilter in a GtkFileChooser when I set/select a file?

I tried

    gtk_file_chooser_set_file (GTK_FILE_CHOOSER (dialog), file, NULL);
    gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filefilter);

and some variants (select_file, adding the filter before setting it,
setting the filter before setting the file, ...) For new files I use

    gtk_file_chooser_set_current_folder_file (GTK_FILE_CHOOSER (dialog), folder_file, NULL);
    gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (dialog), name);
    gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filefilter);

and it works just fine.

What did I miss?

Thanks,
Joerg

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]