Real-time word scanning in TextView?


My first post here! I am just starting with Gtk2 and Glade but cannot
solve the following problem, although I did read some tutorials. (I am
not able to read the C APIs and translate that to Perl code, stupid

I made a little text editor using the TextView window. What I want to do
is to check every single word the user types (so in 'real-time'), plus
the context of that word, let's say seven or ten words before the last
word typed. So basically I want to extract a string of about 40 or 70
characters from the TextView window (and check that in Perl). 

If something is found that is considered 'wrong', the word or the words
must be underligned. So it resembles the Gtk2::Spell module a bit,
except that I want to do my 'own' things with the text typed. 

As far as I understand, the 'iter' thing is not the right way to go,
because iters change every time the user types something. So I must use
'marks'? If so, can someone give me some lines of example code, because
I do not see how this marks stuff works. Or is there an easier way? I
also saw functions like to_end_word or something, but same story here: I
don't see how that works. 

Any help would be greatly appreciated. 

Cheers, Paul. 

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