[pygtk] Fwd: Re: TextBuffer to Markup

Bradlee Landis bradleelandis at gmail.com
Thu Feb 17 02:21:33 WST 2011


On Wed, Feb 16, 2011 at 11:15 AM, Smartboy <smartboyathome at gmail.com> wrote:
> How have you been applying the formatting, using gtk.TextTags?

Oh, I had assumed that I could use a pango.attrlist with a textbuffer.
What a pain...

> I have a project on github called SmartTE (a rich text editor along the same vein
> as wordpad) which is already starting to age in terms of my skill, but
> the functions textConvertTo and textConvertFrom should give you an
> example of how you can save and restore formatting from a file.

We are also using undobuffer in our code
(https://bitbucket.org/tiax/gtk-textbuffer-with-undo/src/3eccc06ca82d/undobuffer.py),
so I'll have to make some changes to implement both. I may take a look
at your code, but what I want is just a function that converts between
text markup (in whatever format is best) to something I can use with
the buffer.

The best solution may be to analyze your code and roll my own similar
solution. Thanks for the suggestion.

Brad Landis


More information about the pygtk mailing list