]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/textctrl.cpp
Add wxLoadUserResource() overload not copying the resource data.
[wxWidgets.git] / src / gtk / textctrl.cpp
index a29fc541833eabf1600c7d79d07dbb6b5ab27db2..6a8d22424a41b5dac8af4015337c82f6774befbf 100644 (file)
@@ -351,7 +351,7 @@ extern "C" {
 static void
 au_check_word( GtkTextIter *s, GtkTextIter *e )
 {
-    static const char *URIPrefixes[] =
+    static const char *const URIPrefixes[] =
     {
         "http://",
         "ftp://",
@@ -704,6 +704,9 @@ bool wxTextCtrl::Create( wxWindow *parent,
         // a single-line text control: no need for scrollbars
         m_widget =
         m_text = gtk_entry_new();
+        // work around probable bug in GTK+ 2.18 when calling WriteText on a
+        // new, empty control, see http://trac.wxwidgets.org/ticket/11409
+        gtk_entry_get_text((GtkEntry*)m_text);
 
         if (style & wxNO_BORDER)
             g_object_set (m_text, "has-frame", FALSE, NULL);
@@ -1717,7 +1720,14 @@ bool wxTextCtrl::GetStyle(long position, wxTextAttr& style)
         style.SetBackgroundColour(pattr->appearance.bg_color);
         style.SetTextColour(pattr->appearance.fg_color);
 
-        // TODO: set font, alignment, tabs and indents
+        const wxGtkString
+            pangoFontString(pango_font_description_to_string(pattr->font));
+
+        wxFont font;
+        if ( font.SetNativeFontInfo(wxString(pangoFontString)) )
+            style.SetFont(font);
+
+        // TODO: set alignment, tabs and indents
     }
 
     return true;