X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d5d20078e0c48b1b578bd0acb0ee16593c20f236..18666b42ca62c24cb3097c32b5108f57bbb7eec6:/src/gtk/textctrl.cpp diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 7e5b5f5472..e30c23e4da 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -685,8 +685,9 @@ bool wxTextCtrl::Create( wxWindow *parent, if (style & wxNO_BORDER) g_object_set (m_text, "has-frame", FALSE, NULL); - + } + g_object_ref(m_widget); m_parent->DoAddChild( this ); @@ -959,16 +960,16 @@ void wxTextCtrl::DoSetValue( const wxString &value, int flags ) { if ( !(flags & SetValue_SendEvent) ) EnableTextChangedEvents(false); - + gtk_text_buffer_set_text( m_buffer, "", 0 ); - + if ( !(flags & SetValue_SendEvent) ) EnableTextChangedEvents(true); - + return; } -#ifdef wxUSE_UNICODE +#if wxUSE_UNICODE const wxCharBuffer buffer(value.utf8_str()); #else wxFontEncoding enc = m_defaultStyle.HasFont() @@ -1006,9 +1007,6 @@ void wxTextCtrl::DoSetValue( const wxString &value, int flags ) { EnableTextChangedEvents(true); } - - // This was added after discussion on the list - SetInsertionPoint(0); } void wxTextCtrl::WriteText( const wxString &text ) @@ -1024,7 +1022,7 @@ void wxTextCtrl::WriteText( const wxString &text ) return; } -#ifdef wxUSE_UNICODE +#if wxUSE_UNICODE const wxCharBuffer buffer(text.utf8_str()); #else // check if we have a specific style for the current position