X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/268331f0db16ca664a591357e10438500b87ee20..d60957aac53d7057bd5d72b9f66d3df89b3f9e5b:/src/gtk/filedlg.cpp diff --git a/src/gtk/filedlg.cpp b/src/gtk/filedlg.cpp index a2f0712854..6f3b775ada 100644 --- a/src/gtk/filedlg.cpp +++ b/src/gtk/filedlg.cpp @@ -116,6 +116,15 @@ static void gtk_filedialog_response_callback(GtkWidget *w, gtk_filedialog_cancel_callback(w, dialog); } +static void gtk_filedialog_selchanged_callback(GtkFileChooser *chooser, + wxFileDialog *dialog) +{ + wxGtkString filename(gtk_file_chooser_get_preview_filename(chooser)); + + dialog->GTKSelectionChanged(wxString::FromUTF8(filename)); +} + + static void gtk_filedialog_update_preview_callback(GtkFileChooser *chooser, gpointer user_data) { @@ -249,6 +258,8 @@ bool wxFileDialog::Create(wxWindow *parent, const wxString& message, g_signal_connect (m_widget, "response", G_CALLBACK (gtk_filedialog_response_callback), this); + g_signal_connect (m_widget, "selection-changed", + G_CALLBACK (gtk_filedialog_selchanged_callback), this); // deal with extensions/filters SetWildcard(wildCard); @@ -463,4 +474,12 @@ int wxFileDialog::GetFilterIndex() const return m_fc.GetFilterIndex(); } +void wxFileDialog::GTKSelectionChanged(const wxString& filename) +{ + m_currentlySelectedFilename = filename; + + if (m_extraControl) + m_extraControl->UpdateWindowUI(wxUPDATE_UI_RECURSE); +} + #endif // wxUSE_FILEDLG