Re: finding the beginning of the current line in a text buffer



On 2003.06.17 04:24, Rajarshi Guha wrote:
Hi,
  I'm using a GtkTextView and its associated GtkTextBuffer. What I need
to do is to insert a character at the beginning of the current line when
the user presses a button.

I see that I need to use gtk_text_buffer_get_iter_at_line () but how do
I get the current line number in the text buffer?

$ grep display_line gtktextview.h
gboolean gtk_text_view_forward_display_line           (GtkTextView       *text_view,
gboolean gtk_text_view_backward_display_line          (GtkTextView       *text_view,
gboolean gtk_text_view_forward_display_line_end       (GtkTextView       *text_view,
gboolean gtk_text_view_backward_display_line_start    (GtkTextView       *text_view,
gboolean gtk_text_view_starts_display_line            (GtkTextView       *text_view,

will help you, after getting the iter of cursor from mark "insert", or by another way.

kz.



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