]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/fontpicker.cpp
Disable wxUSE_ENH_METAFILE for wxGTK builds.
[wxWidgets.git] / src / gtk / fontpicker.cpp
index a0e12a4978fbe14951268a5ff546d6764f4fdfc9..9aea074e1ace8f0c01a1c1d14e723f9370d605ca 100644 (file)
@@ -17,7 +17,7 @@
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
-#if wxUSE_FONTPICKERCTRL 
+#if wxUSE_FONTPICKERCTRL
 
 #include "wx/fontpicker.h"
 
@@ -42,7 +42,7 @@ static void gtk_fontbutton_setfont_callback(GtkFontButton *widget,
 
     // fire the colour-changed event
     wxFontPickerEvent event(p, p->GetId(), p->GetSelectedFont());
-    p->GetEventHandler()->ProcessEvent(event);
+    p->HandleWindowEvent(event);
 }
 }
 
@@ -66,6 +66,7 @@ bool wxFontButton::Create( wxWindow *parent, wxWindowID id,
     }
 
     m_widget = gtk_font_button_new();
+    g_object_ref(m_widget);
 
     // set initial font
     m_selectedFont = initial.IsOk() ? initial : *wxNORMAL_FONT;
@@ -80,8 +81,6 @@ bool wxFontButton::Create( wxWindow *parent, wxWindowID id,
     gtk_font_button_set_use_size(GTK_FONT_BUTTON(m_widget), usefont);
     gtk_font_button_set_use_font(GTK_FONT_BUTTON(m_widget), usefont);
 
-    gtk_widget_show(m_widget);
-
     // GtkFontButton signals
     g_signal_connect(m_widget, "font-set",
                     G_CALLBACK(gtk_fontbutton_setfont_callback), this);