Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to change font attributes (size, style, family, colour) for Text Entry but I don't see any option for this in Glade. There's no problem with Label, but Label is not editable by user. I tried to edit the MyAppNameWindow.ui file in Gedit and copied attributes from Label to Text Entry but after that the app does not start.

share|improve this question
up vote 3 down vote accepted

I do not know how to do this using Glade. However, this is simple to achieve using a small piece of code.

I assume you are using quickly, and thus you write in Python.

  • First, you need to import Pango library (it comes by default with Gtk)

    from gi.repository import Pango

  • Then, assuming your entry widget is called myentry:

    myentry.modify_font(Pango.FontDescription('Sans Bold 12'))

Adjust the above to your needs, and remember place that instruction somewhere in initialization code, so that it gets executed just after the window is constructed.

I hope such non-Glade solution will help you.

share|improve this answer
Thanks, it does work. I tried before with import pango but got some error. – mivoligo Jun 26 '12 at 22:08

Your Answer


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.