X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a66954a67378a1deb5ab6c4299503c82a1e65b62..ee3510132b8b4160f848bd4f502a6f5315f90dbc:/src/gtk1/textctrl.cpp diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 8dff685433..1c63ae186e 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -791,9 +791,19 @@ void wxTextCtrl::SetSelection( long from, long to ) gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to ); } -void wxTextCtrl::ShowPosition( long WXUNUSED(pos) ) +void wxTextCtrl::ShowPosition( long pos ) { -// SetInsertionPoint( pos ); + if (m_windowStyle & wxTE_MULTILINE) + { + GtkAdjustment *vp = GTK_TEXT(m_text)->vadj; + float totalLines = (float) GetNumberOfLines(); + long posX; + long posY; + PositionToXY(pos, &posX, &posY); + float posLine = (float) posY; + float p = (posLine/totalLines)*(vp->upper - vp->lower) + vp->lower; + gtk_adjustment_set_value(GTK_TEXT(m_text)->vadj, p); + } } long wxTextCtrl::GetInsertionPoint() const