]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/textctrl.cpp
(blind) wxUniv compilation fix: define the method using wxWindow out of line, i.e...
[wxWidgets.git] / src / gtk1 / textctrl.cpp
index dcc5791ef7e3e2f7c09ed4e08bc0b71690a2b770..d91d2bf5f18dd18c468d217cd63c5da45e8060cd 100644 (file)
@@ -487,16 +487,19 @@ bool wxTextCtrl::Create( wxWindow *parent,
             gtk_text_view_set_justification( GTK_TEXT_VIEW(m_text), GTK_JUSTIFY_CENTER );
         // Left justify (alignment) is the default and we don't need to apply GTK_JUSTIFY_LEFT
     }
-    // gtk_entry_set_alignment was introduced in gtk+-2.3.5
-#if GTK_CHECK_VERSION(2, 3, 5)
     else
     {
-        if (style & wxTE_RIGHT)
-            gtk_entry_set_alignment( GTK_ENTRY(m_text), 1.0 );
-        else if (style & wxTE_CENTRE)
-            gtk_entry_set_alignment( GTK_ENTRY(m_text), 0.5 );
+#ifdef __WXGTK24__
+        // gtk_entry_set_alignment was introduced in gtk+-2.3.5
+        if (!gtk_check_version(2,4,0))
+        {
+            if (style & wxTE_RIGHT)
+                gtk_entry_set_alignment( GTK_ENTRY(m_text), 1.0 );
+            else if (style & wxTE_CENTRE)
+                gtk_entry_set_alignment( GTK_ENTRY(m_text), 0.5 );
+        }
+#endif
     }
-#endif // gtk+-2.3.5
 #endif // __WXGTK20__
     
     // We want to be notified about text changes.
@@ -600,8 +603,7 @@ void wxTextCtrl::SetValue( const wxString &value )
 #else
         wxCharBuffer buffer( wxConvUTF8.cWC2MB( wxConvLocal.cWX2WC( value ) ) );
 #endif
-        GtkTextBuffer *text_buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(m_text) );
-        if (gtk_text_buffer_get_char_count(text_buffer) != 0)
+        if (gtk_text_buffer_get_char_count(m_buffer) != 0)
             IgnoreNextTextUpdate();
 
         gtk_text_buffer_set_text( m_buffer, buffer, strlen(buffer) );