Pier wrote:

>Hi,
>I've a gtkTextBuffer with many tags applied, and I want to know if the
>cursor is into a region where for example a tag named "default" is
>applied: how can I do?
>
As with the Tk text widget, the insertion point is a special mark named 
"insert".  You can get a reference to this mark with the following:
  insertionpoint = buffer.get_insert()
or
  insertionpoint = buffer.get_mark("insert")

Then you can get a GtkTextIter that represents the position in the 
buffer where the insertion point is:
  iter = buffer.get_iter_at_mark(insertionpoint)

You can then check whether the tag is active at this point in the buffer 
with:
  if iter.has_tag(tag): ...

(this is the GtkTextTag object -- not the tag name, btw).

James.

-- 
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to