[pygtk] Default font/style for text view

Stephen George steve_geo at optusnet.com.au
Wed Feb 6 10:08:42 WST 2008


Excellent, .. thanks Markus, .. just what I was looking for.

Cheers.
Steve

markus espenhain wrote:
> On Wed, 2008-02-06 at 11:16 +1100, Stephen George wrote:
>   
>> Hi All,
>>
>> Can't work out how to set a default font/style for a text view.
>>
>> I want to set the font bold and larger, user will not have option to 
>> change it.
>>
>> Is there a way?
>>
>>     
>
> yes ...
>
> tv = gtk.TextView()
> tv.modify_font(pango.FontDescription('sans bold 26'))
>
> http://www.pygtk.org/docs/pygtk/class-gtkwidget.html#method-gtkwidget--modify-font
> http://www.pygtk.org/docs/pygtk/class-pangofontdescription.html
>   


More information about the pygtk mailing list