- gtk_text_view_scroll_mark_onscreen
- (
- GTK_TEXT_VIEW(m_text),
- gtk_text_buffer_get_insert( m_buffer )
- );
-#else // GTK+ 1.x
- gtk_signal_disconnect_by_func( GTK_OBJECT(m_text),
- GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
-
- /* we fake a set_point by inserting and deleting. as the user
- isn't supposed to get to know about this non-sense, we
- disconnect so that no events are sent to the user program. */
-
- gint tmp = (gint)pos;
- gtk_editable_insert_text( GTK_EDITABLE(m_text), " ", 1, &tmp );
- gtk_editable_delete_text( GTK_EDITABLE(m_text), tmp-1, tmp );
-
- gtk_signal_connect( GTK_OBJECT(m_text), "changed",
- GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
-
- // bring editable's cursor uptodate. Bug in GTK.
- SET_EDITABLE_POS(m_text, gtk_text_get_point( GTK_TEXT(m_text) ));
-#endif // GTK+ 2/1
- }
- else
- {
- gtk_entry_set_position( GTK_ENTRY(m_text), (int)pos );
-
- // Bring editable's cursor uptodate. Bug in GTK.
- SET_EDITABLE_POS(m_text, (guint32)pos);
- }
-}
-
-void wxTextCtrl::SetInsertionPointEnd()
-{
- wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") );
-
- if (m_windowStyle & wxTE_MULTILINE)
- {
-#ifdef __WXGTK20__
- GtkTextIter end;
- gtk_text_buffer_get_end_iter( m_buffer, &end );
- gtk_text_buffer_place_cursor( m_buffer, &end );
-#else
- SetInsertionPoint(gtk_text_get_length(GTK_TEXT(m_text)));
-#endif
+ GtkTextMark* mark = gtk_text_buffer_get_insert(m_buffer);
+ 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);