]> git.saurik.com Git - wxWidgets.git/commitdiff
use GTK-specific method to delete selection
authorPaul Cornett <paulcor@bullseye.com>
Tue, 23 Jul 2013 14:41:14 +0000 (14:41 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Tue, 23 Jul 2013 14:41:14 +0000 (14:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/textctrl.cpp

index 10a90eaad78622c769de2343fc33f5984a2ad886..4dca1870f67ca006fef0c807f28bb8fb09dd1260 100644 (file)
@@ -1121,11 +1121,7 @@ void wxTextCtrl::WriteText( const wxString &text )
 #endif
 
     // First remove the selection if there is one
 #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 );
 
     // Insert the text
     wxGtkTextInsert( m_text, m_buffer, m_defaultStyle, buffer );