- gtk_text_buffer_get_start_iter( m_buffer, &iter );
- gtk_text_iter_set_offset( &iter, pos );
- GtkTextMark *mark = gtk_text_buffer_create_mark( m_buffer, NULL, &iter, TRUE );
- gtk_text_view_scroll_to_mark( GTK_TEXT_VIEW(m_text), mark, 0.0, FALSE, 0.0, 0.0 );
+ gtk_text_buffer_get_iter_at_offset(m_buffer, &iter, int(pos));
+ GtkTextMark* mark = gtk_text_buffer_get_mark(m_buffer, "ShowPosition");
+ gtk_text_buffer_move_mark(m_buffer, mark, &iter);
+ if (IsFrozen())
+ // defer until Thaw, text view is not using m_buffer now
+ m_showPositionOnThaw = mark;
+ else
+ gtk_text_view_scroll_mark_onscreen(GTK_TEXT_VIEW(m_text), mark);