Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have TextView widget in Glade named "formula-view". I'm trying to do this to change font:

formulaView = self.builder.get_object("formula-view")
fontdesc = pango.FontDescription('Ubuntu 16')
formulaView.override_font(fontdesc)

But this works with error. How to correctly change font?

I just want to change the font of a widget, but I don't know how to do it. Error looks like this: AttributeError: type object 'Context' has no attribute '__info__'

share|improve this question
    
Could you be more specific? Which kind of error are you getting? –  David Planella Jun 20 '12 at 7:37
    
I just want to change the font of a widget, but I don't know how to do it. Error looks like this: AttributeError: type object 'Context' has no attribute '__info__' –  mtcomscxstart Jun 20 '12 at 8:26
add comment

1 Answer

Try doing this instead:

tv = self.builder.get_object('textview')
font = pango.FontDescription('Ubuntu 16')
tv.modify_font(font)
share|improve this answer
    
This also doesn't work –  mtcomscxstart Jun 26 '12 at 14:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.