gtk_file_chooser_set_choice doesn't set choice
If the choice added with gtk_file_chooser_add_choice
is in the form of a dropdown menu, the selected option doesn't get set with gtk_file_chooser_set_choice
.
Steps to reproduce
Run the testfilechooser test program. This contains the following code:
gtk_file_chooser_add_choice (GTK_FILE_CHOOSER (dialog), "choice1",
"Choose one:",
(const char *[]){"one", "two", "three", NULL},
(const char *[]){"One", "Two", "Three", NULL});
gtk_file_chooser_set_choice (GTK_FILE_CHOOSER (dialog), "choice1", "two");
Current behavior
The 'One' option is selected, both in the dropdown itself and in the underlying list model. This can be verified with gtk_file_chooser_get_choice
.
Expected outcome
'Two' should be selected.
Version information
GTK 4.9.2 (main branch built from source), GTK 4.6.9 (probably older versions too)
Built with the default settings through Builder on Fedora 36
Additional information
I'm going to submit a merge request with a fix shortly.