Re: Cursor position in Textarea - TextWidget



On Mon, Feb 24, 2003 at 03:00:31PM -0800, Vikram Bartakke wrote:
Hi List,

I specifically want to know how to find the current cursor position 
in terms of rows/ columns and not in terms of pixels? At present if
I use "button-press-event" the values of x and y co-ordinates are
something like this x=268,y=312 etc. I want that if i click in the 
text area I should able to get correct line number where the cursor 
is at?


Look at gtk_text_view_window_to_buffer_coords(),
and gtk_text_view_get_iter_at_location().

gtk_text_iter_get_line() will get the line number.

  -jkl



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