- if (g_isIdle)
- wxapp_install_idle_handler();
-
- GtkFontSelectionDialog *fontdlg = GTK_FONT_SELECTION_DIALOG(dialog->m_widget);
-
- wxGtkString fontname(gtk_font_selection_dialog_get_font_name(fontdlg));
- dialog->SetChosenFont( fontname);
-
- wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
- event.SetEventObject( dialog );
- dialog->GetEventHandler()->ProcessEvent( event );
-}
-}
-
-//-----------------------------------------------------------------------------
-// "clicked" for Cancel-button
-//-----------------------------------------------------------------------------
-
-extern "C" {
-static
-void gtk_fontdialog_cancel_callback( GtkWidget *WXUNUSED(w), wxFontDialog *dialog )
-{
- if (g_isIdle)
- wxapp_install_idle_handler();
+ int rc = wxID_CANCEL;
+ if (response_id == GTK_RESPONSE_OK)
+ {
+ rc = wxID_OK;
+#if GTK_CHECK_VERSION(3,2,0)
+ if (gtk_check_version(3,2,0) == NULL)
+ {
+ wxNativeFontInfo info;
+ info.description = gtk_font_chooser_get_font_desc(GTK_FONT_CHOOSER(dialog));
+ win->GetFontData().SetChosenFont(wxFont(info));
+ }
+ else
+#endif
+ {
+ GtkFontSelectionDialog* sel = GTK_FONT_SELECTION_DIALOG(dialog);
+ wxGtkString name(gtk_font_selection_dialog_get_font_name(sel));
+ win->GetFontData().SetChosenFont(wxFont(wxString::FromUTF8(name)));
+ }
+ }