X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/581ee8a9c5cc369e556b6749fe106fe2f95ce7bc..6804a3f7197d4720e4c2fc812af2ae364986c07b:/src/gtk1/textctrl.cpp diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index c91af21b5e..007c091073 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -994,7 +994,14 @@ void wxTextCtrl::SetSelection( long from, long to ) if (m_windowStyle & wxTE_MULTILINE) { #ifdef __WXGTK20__ - // ???? + GtkTextBuffer *buf = gtk_text_view_get_buffer( GTK_TEXT_VIEW(m_text) ); + + GtkTextIter fromi, toi; + gtk_text_buffer_get_iter_at_offset( buf, &fromi, from ); + gtk_text_buffer_get_iter_at_offset( buf, &toi, to ); + + gtk_text_buffer_place_cursor( buf, &toi ); + gtk_text_buffer_move_mark_by_name( buf, "selection_bound", &fromi ); #else gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to ); #endif