Re: TextView and position of the text cursor



I just find the answer of my question. I share with you the answer :

In a inherent class of TextView :

Gtk::TextBuffer::iterator iter = get_buffer()->get_insert()->get_iter();
printf("offset : %i\tline : %i\tline_index : %i\n\n",
			iter.get_offset(),
			iter.get_line(),
			iter.get_line_index());

get_offset() : gives the number of character before the cursor
get_line() : get the current line of the cursor
get_line_index() : get the number of character before the cursor in the
current line
--
View this message in context: http://www.nabble.com/TextView-and-position-of-the-text-cursor-t1446337.html#a3917992
Sent from the Gtkmm forum at Nabble.com.




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