]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/textctrl.cpp
Various changes
[wxWidgets.git] / src / gtk / textctrl.cpp
index 5d5b5056b3d91add0c23a2dc502ed1adf03d0fbc..f5e26432872a40710706cc4c0cd03844bdad5978 100644 (file)
@@ -429,5 +429,25 @@ bool wxTextCtrl::IsOwnGtkWindow( GdkWindow *window )
     return (window == GTK_ENTRY(m_text)->text_area);
 }
 
+void wxTextCtrl::SetFont( const wxFont &font )
+{
+  m_font = font;
+  
+  GtkStyle *style = (GtkStyle*) NULL;
+  if (!m_hasOwnStyle)
+  {
+    m_hasOwnStyle = TRUE;
+    style = gtk_style_copy( gtk_widget_get_style( m_text ) );
+  }
+  else
+  {
+    style = gtk_widget_get_style( m_text );
+  }
+  
+  gdk_font_unref( style->font );
+  style->font = gdk_font_ref( m_font.GetInternalFont( 1.0 ) );
+  
+  gtk_widget_set_style( m_text, style );
+}