[pygtk] Styling a text view across the visible line

John Finlay finlay at moeraki.com
Sat Oct 10 06:35:11 WST 2009


Scott Ferguson wrote:
> Hi,
>
> I'm trying to build an integrated diff tool for an app that I'm 
> writing, and I am styling the text to make certain parts of the diff 
> more visible (adds are green, removes are red, etc).  Typical look and 
> feel of a diff viewer.  
>
> The styling includes a background and foreground color.  Currently I'm 
> iterating over each line of the gtk.TextBuffer, creating an ending 
> iterator at the next line, and styling everything between the line 
> start, and the start of the following line.  My issue is that I would 
> like the background color to carry straight across the gtk.TextView, 
> not end where the line ends (on the '\n' character).  A single line 
> should have a highlight from left to right.
>
> Is this possible with a stock gtk.TextView?  My current formatting 
> function can be found here: http://gist.github.com/206387
>
Try setting the 'paragraph-background' property of the tag.

John


More information about the pygtk mailing list