Why can't the GtkFileChooserButton be used for saving/creating folders?

If you try to create a GtkFileChooserButton with either GTK_FILE_CHOOSER_ACTION_SAVE or GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER, it will fail an assertion, specifically this one: https://gitlab.gnome.org/GNOME/gtk/-/blob/gtk-3-24/gtk/gtkfilechooserbutton.c#L3020

Why is that? Am I missing something here? Would be using this for saving files somehow stupid?

GtkFileChooserButton is meant to be used to select folders, because that’s the primary user interaction. If you need to do open any other location, it will open a file selection dialog—which is why there’s a whole constructor for setting your own dialog.

In practice, GtkFileChooserButton has always been a very limited widget, with a weird interaction model; that’s why it was removed from GTK 4.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.