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



On Mon, 2003-06-16 at 20:07, Kang Jeong-Hee wrote:
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.


I should have rephrased that question - how do I get the iterator for
the current cursor position. I see that there is a function that returns
the 'insert' mark. But that returns a GtkTextMark - how can I go from a
text mark to an iterator?

Thanks,

-------------------------------------------------------------------
Rajarshi Guha <rajarshi presidency com> <http://jijo.cjb.net>
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04 06F7 1BB9 E634 9B87 56EE
-------------------------------------------------------------------
The only perfect science is hindsight.




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