+static void gtk_filedialog_update_preview_callback(GtkFileChooser *chooser,
+ gpointer user_data)
+{
+#if GTK_CHECK_VERSION(2,4,0)
+ GtkWidget *preview = GTK_WIDGET(user_data);
+
+ gchar *str = gtk_file_chooser_get_preview_filename(chooser);
+ wxGtkString filename(str);
+ if (str) g_free(str);
+
+ if ( !filename )
+ return;
+
+ GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file_at_size(filename, 128, 128, NULL);
+ gboolean have_preview = pixbuf != NULL;
+
+ gtk_image_set_from_pixbuf(GTK_IMAGE(preview), pixbuf);
+ if ( pixbuf )
+ g_object_unref (pixbuf);
+
+ gtk_file_chooser_set_preview_widget_active(chooser, have_preview);
+#else
+ wxUnusedVar(chooser);
+ wxUnusedVar(user_data);
+#endif // GTK+ 2.4+
+}
+
+} // extern "C"
+
+
+//-----------------------------------------------------------------------------
+// wxFileDialog
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxFileDialog,wxGenericFileDialog)
+
+BEGIN_EVENT_TABLE(wxFileDialog,wxGenericFileDialog)
+ EVT_BUTTON(wxID_OK, wxFileDialog::OnFakeOk)
+END_EVENT_TABLE()
+
+wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message,
+ const wxString& defaultDir,
+ const wxString& defaultFileName,
+ const wxString& wildCard,
+ long style, const wxPoint& pos,
+ const wxSize& sz,
+ const wxString& name)
+ : wxGenericFileDialog(parent, message, defaultDir, defaultFileName,
+ wildCard, style, pos, sz, name, true )
+{
+ if (gtk_check_version(2,4,0))
+ {
+ wxGenericFileDialog::Create( parent, message, defaultDir,
+ defaultFileName, wildCard, style, pos );
+ return;