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

How do I get dark toolbars in gtkmm like in gedit or system settings? I can only seem to find how to do it in pyGTK.

share|improve this question
up vote 3 down vote accepted

I presume that you just need to map the Python GTK functions to GTKMM. The code in Python GTK is:

context = self.toolbar.get_style_context()

So you just need to find the equivilent of get_style_context() and add_class() and the Gtk.STYLE_CLASS_PRIMARY_TOOLBAR constant.

share|improve this answer
I don't know why i didn't find this before: link – Sam Bickley Jun 20 '12 at 22:37
This is the desired gtkmm equivelent: Glib::RefPtr<Gtk::StyleContext> sc = toolbar.get_style_context(); sc->add_class("primary-toolbar"); – Rafał Cieślak Dec 19 '12 at 19:42

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.