Diego Anzoátegui wrote:

Hello,
When i read the pygtk-docs, says that create_tag take 2 arguments, but the python interpreter raise an error saying that create_tag takes exactly one argument. Another one: to insert text in TextBuffer i need a TextIter object, but i can't create it with the gtk.TextIter class 'cause it's an abstract widget. Can someone post an example of a TextBuffer example usage? Thanks a lot

This is an area where the generated documentation is not accurate (due to the Python interface differing slightly).

In C, GtkTextIter's are stack allocated, so you just define a GtkTextIter variable and call a function to point the textiter at a particular location in the buffer. In Python, the functions for setting text iters have been changed so that they no longer take the text iter as an argument, but instead allocate a new iter and return it.

There is some example code for using a GtkTextBuffer in the examples/pygtk-demo/pygtk-demo.py file which might help you.

James.

--
Email: [EMAIL PROTECTED] | Linux.conf.au http://linux.conf.au/
WWW: http://www.daa.com.au/~james/ | Jan 22-25 Perth, Western Australia.


_______________________________________________
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