Re: GtkTextBuffer question



On Tue, 16 Jul 2002, Jeffrey Morgan wrote:

What is the correct way to get the current cursor position
within a GtkTextBuffer/GtkTextView?

So far as I can tell (supposing you have a GtkTextView named "view"
and you want to get an "iter" at the current position):

GtkTextBuffer *buf;
GtkTextIter iter;

buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view));
gtk_text_buffer_get_iter_at_mark(buf, &iter,
                       gtk_text_buffer_get_mark(buf, "insert")

Allin Cottrell.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]