diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 10a90eaad7..4dca1870f6 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -1121,11 +1121,7 @@ void wxTextCtrl::WriteText( const wxString &text ) #endif // First remove the selection if there is one - // TODO: Is there an easier GTK specific way to do this? - long from, to; - GetSelection(&from, &to); - if (from != to) - Remove(from, to); + gtk_text_buffer_delete_selection(m_buffer, false, true); // Insert the text wxGtkTextInsert( m_text, m_buffer, m_defaultStyle, buffer );