X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/00a399c062ce76fbfa9ea0bc2c208a9a144a7528..5bac960d404f6fc82f6d7c4c697dd018657d24ab:/src/gtk/textctrl.cpp diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 629a6fbfae..bce644abf4 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -2,7 +2,6 @@ // Name: src/gtk/textctrl.cpp // Purpose: // Author: Robert Roebling -// Id: $Id$ // Copyright: (c) 1998 Robert Roebling, Vadim Zeitlin, 2005 Mart Raudsepp // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -1121,11 +1120,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 ); @@ -1618,7 +1613,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &key_event ) { if ( HasFlag(wxTE_PROCESS_ENTER) ) { - wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); + wxCommandEvent event(wxEVT_TEXT_ENTER, m_windowId); event.SetEventObject(this); event.SetString(GetValue()); if ( HandleWindowEvent(event) )