The Devhelp says that GtkTextIter will be invalidated when the contents in GtkBuffer are changed and the GtkTextMark solve this problem. So how to insert GtkTextMark into buffer? and how to use it?
Add a mark with gtk_text_buffer_create_mark()
. Usually you will want to give the mark a name so that you can retrieve it later, or move it.
Then, when you need to re-validate your iterator, use gtk_text_buffer_get_iter_at_mark()
.