Getting the Coords of TextView cursor


I am using a GtkTextView which is added to a
GtkScrolledWindow. Now whenever the GtkTextView gets
focus, I want the scrolled window to scroll in such a
manner so that the cursor is visible. How can I
achieve this?

One way I thought of is that, I get the location of
iterator where the cursor is placed and based on the
'Y' value of the location, I set the adjustment value
for the scrolled window. But this doesn't work since
the gtk_text_view_get_iter_location is returning same
value no matter where the cursor is, also converting
the values to window coords using
gtk_text_view_buffer_to_window_coords with
GTK_TEXT_WINDOW_WIDGET as the window type, gives weird

Can anyone suggest a better working way to achieve the


Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 

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