On Mon, Nov 24, 2008 at 12:27 PM, Luis Javier Peris <[EMAIL PROTECTED]>wrote:
> Hello everybody! > > I would know if there's a *simple* way having a string marked up with the > Pango text markup language to set it in a TextBuffer, I mean the same > purpose of *set_markup gtk.Label* method but for gtk.TextBuffer, that's: > > Get from a string like <b>Test</b> visualize in a textbuffer like: *Test > > *Thanks in advance. > It's not simple, but I have written a library to do this as part of my recipe app Gourmet -- you're welcome to use it: http://grecipe-manager.cvs.sourceforge.net/viewvc/grecipe-manager/grm/src/lib/gtk_extras/TextBufferMarkup.py?revision=1.2&view=markup Using my library's PangoBuffer class, you can just do this... pb = PangoBuffer() pb.set_text('<b>Hello</b>') As the name implies, it's designed to support any markup supported by pango elsewhere. The library also makes it really easy to implement a basic rich text editor to allow the user to apply these properties. Last time this came up ( http://www.daa.com.au/pipermail/pygtk/2005-November/011314.html), Gustavo also offered up another similar library: http://www.gnome.org/~gjc/htmltextview.py<http://www.gnome.org/%7Egjc/htmltextview.py> Hope this helps! Tom
_______________________________________________ pygtk mailing list [email protected] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
