Update the shown file name in wxGTK wxFilePickerCtrl::SetPath()

This still doesn't work if the file doesn't exist, but at least shows
the correct file name if it does exist, which is better than nothing and
the best we can reasonably do when using the native control.

Closes #19163.
This commit is contained in:
Vadim Zeitlin
2021-09-21 01:00:07 +02:00
parent bd423096df
commit 9604c729bf

View File

@@ -135,7 +135,9 @@ void wxFileButton::SetPath(const wxString &str)
{
m_path = str;
if (m_dialog)
if (GTK_IS_FILE_CHOOSER(m_widget))
gtk_file_chooser_set_filename((GtkFileChooser*)m_widget, str.utf8_str());
else if (m_dialog)
UpdateDialogPath(m_dialog);
}