[pygtk] set_tabs in a gtk.TextView

John Finlay finlay at moeraki.com
Wed Jul 5 17:14:29 WST 2006


John Pye wrote:
> Hi all,
>
> I have some plain text material that I want to show in a TextView. The 
> plaintext contains some tab characters, \t.
>
> I would have expected that if I set_tabs on my TextView, then stuck 
> the text into the associated TextBuffer, then it would render such 
> that the text following '\t' characters line up with the tab stops I 
> specify.
>
> Should this work? Or am I misunderstanding how to use this? Are there 
> flags on the TextView that I need to set, perhaps?
That should work. One thing to watch out for is the units used for the 
tab positions. Pango units are really small compared to pixel units (1024:1)

John


More information about the pygtk mailing list