how to get the cursor location when the user clicks into a textview?

its not clear to me how to get a mouse click to map to native row,column coordinates or even a buffer offset 
(0-based byte offset from start of text buffer).

all I can get is window coords and when I try to make a call to 'gtk_text_view_window_to_buffer_coords', I 
get back the same x,y numbers I send into that call!

I really just want to get a simple offset from this buffer:

cur_gtk_text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (command_text_output_textview));

so that when the user clicks into that textview (ie, just moves the blue blinking cursor so his mouse 
location by  a single click into the textview), I'd like to get the 'array' location of the char the user 
clicked on.  and NOT some pixel count from the GDK system.


thanks ;)


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