How can I read the cursor position in a GTK+2.0 GtkTextView ?



Hi,

I want my application to be aware of any tag existing at cursor location in a 
GtkTextView.

This can easily be done when positionning the cursor with a click by linking 
the "event" signal of a GtkTextTag.

But what if the user move the cursor with the keyboard?
I'm trying to link the "cursor-move" event of a GtkTextView with a callback 
function that :
        read the cursor position, then
        gtk_text_buffer_set_iter_at_offset ( cursor_position ), then
        gtk_text_iter_get_tags ( iter )
but I don't know how to pass the first step ( I reviewed and reviewed the API 
doc without finding the answer)

It is not possible to maintain the offset value in my callback functions, 
because of the <ctrl>-<left/right key> word boundary move.

Steph





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