Hi, for have an iter at the current cursor position you can do: iter=buffer.get_iter_at_mark(buffer.get_insert())
at this point you use iter.get_char() for obtain the current char, then move the iter with iter.backward_char() and again iter.get_char() for check the previous char Best Regards! Pier Il sab, 2003-10-11 alle 06:37, Dàvik ha scritto: > Hi! > > I'd like to know what are the 2 characters around the cursor in a > TextView in a given moment. How should I do it? > > I found TextIter.get_char(), but it only gets the next character, not > the previous. Besides, I don't know how to create a TextIter of the > current offset of the cursor. > > Why all this? I want a TextView where no 2 spaces can be written one > after the other, just like in lyx. > -- Pier Carteri <[EMAIL PROTECTED]> _______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/