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 have used Jono Bacons creating your first ubuntu application to discover how to theme toolbars using the ubuntu theme. I followed the exact same code and the program loads with a black toolbar, however the text on the buttons does not change colour and stays black.

This is an image of my apps issue:

Black text on ambiance

Jono's text colour however turns white when the style is changed.

This is the code I have used:

    self.mainToolbar = self.builder.get_object("mainToolbar")

    mainToolbarStyle = self.mainToolbar.get_style_context()

I have been tearing my hair out over this and I'm sure there is an easy solution.

Thanks very much for any help you can give!


share|improve this question
up vote 1 down vote accepted

I strangely fixed this issue by adding in a Menu Bar that I had removed at the start of my design. The text is now white. I would love to know what caused this!

share|improve this answer
I have the exact same problem in my app and adding menu bar solved it. As per Documentation: "A CSS class to match primary toolbars.This should be used for the 'main' toolbar of an application, right below its menubar." That explains it but it is really weird that we need to add a menubar to make it look good. – user8592 Jul 7 '12 at 8:29

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.