diff --git a/docs/changes.txt b/docs/changes.txt index 00996fb3d8..a3d4a9a5d0 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -163,6 +163,7 @@ wxGTK: - Fix displaying labels of wxRadioBox items. - Add a native implementation for clearing bitmap/window wxGraphicsContexts - Implement XYToPosition() for single-line wxTextCtrl. +- Implement ShowPosition() for single-line wxTextCtrl. wxMSW: diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 7f832eb658..b249f9a076 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -1444,6 +1444,11 @@ void wxTextCtrl::ShowPosition( long pos ) else gtk_text_view_scroll_mark_onscreen(GTK_TEXT_VIEW(m_text), mark); } + else // single line + { // This function not only shows character at required position + // but also places the cursor at this position. + gtk_editable_set_position(GTK_EDITABLE(m_text), pos); + } } wxTextCtrlHitTestResult