]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/textctrl.cpp
Reverted/commented out unsuccessful defer fix
[wxWidgets.git] / src / gtk / textctrl.cpp
index 2fe6b59267fbbc69886ac4372055417b439e097c..47dca6fb4d2c9687074e1e8104173c6af1bf5f97 100644 (file)
@@ -609,10 +609,13 @@ bool wxTextCtrl::Create( wxWindow *parent,
         {
             // GTK_WRAP_WORD_CHAR seems to be new in GTK+ 2.4
 #ifdef __WXGTK24__
-            wrap = GTK_WRAP_WORD_CHAR;
-#else
-            wrap = GTK_WRAP_WORD;
+            if ( !gtk_check_version(2,4,0) )
+            {
+                wrap = GTK_WRAP_WORD_CHAR;
+            }
+            else
 #endif
+            wrap = GTK_WRAP_WORD;
         }
 
         gtk_text_view_set_wrap_mode( GTK_TEXT_VIEW( m_text ), wrap );
@@ -904,6 +907,12 @@ void wxTextCtrl::SetValue( const wxString &value )
         if (gtk_text_buffer_get_char_count(m_buffer) != 0)
             IgnoreNextTextUpdate();
 
+        if ( !buffer )
+        {
+            // what else can we do? at least don't crash...
+            return;
+        }
+        
         gtk_text_buffer_set_text( m_buffer, buffer, strlen(buffer) );
 
 #else
@@ -999,6 +1008,12 @@ void wxTextCtrl::WriteText( const wxString &text )
 #else
         wxCharBuffer buffer( wxConvUTF8.cWC2MB( wxConvLocal.cWX2WC( text ) ) );
 #endif
+        if ( !buffer )
+        {
+            // what else can we do? at least don't crash...
+            return;
+        }
+
         gtk_editable_insert_text( GTK_EDITABLE(m_text), buffer, strlen(buffer), &len );
 
 #else