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 spent few hours searching on google and I gave up now...

I need to change background for popup menu in my app. It set to whatever system default theme is... and I need this to be set to Radiance for all the time.

any ideas how to achieve this?

Here is how it looks now and this need to be light color

share|improve this question
I don't think that property is properly exposed in any pygtk methods. So using normal methods, you can't – RobotHumans Feb 24 '13 at 0:46
I can change toolbar style so why should be a problem changing menu style ? – Majster-pl Feb 24 '13 at 0:47
There's not a method for it: – RobotHumans Feb 24 '13 at 0:54
Congrats, you just proved your question to be off-topic, already answered, and a duplicate all at once. – RobotHumans Feb 24 '13 at 1:33
@Majster-pl: I think AskUbuntu is a perfectly reasonable place to ask a programming question like this, especially as Canonical is trying very hard to encourage a new developer community. Please hang in there – Ian B. Feb 24 '13 at 13:54
up vote 4 down vote accepted

I theme my popup windows like so:

#Use Css themes
css = Gtk.CssProvider()
        .popup {background-color: rgba(0,0,0,0); border: 0px rgba(255,255,255,0);  border-radius: 14px; border-width: 0;  }
Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), css,

#Get popup parent and set rgba visual so I can do transparency

#Give popups the popup CSS class

I also use cairo to draw the popup window and give it a nice texture. To do that I just connect its 'draw' signal to a call back.

I would look at the Radiance Gtk theme to find out what the background color is and use that for the background-color css setting. You can find it in /usr/share/themes/Radiance/Gtk-3.0/gtk.css. If you don't need transparency, then skip the pwindow stuff above and just add the style_context to your popup.

share|improve this answer
This is what I was looking for ;-) Thank you so much @Ian B. I will only need to tweak it a little bit for my purpose – Majster-pl Feb 24 '13 at 14:33
@Ian - Isn't that pygi not pygtk? – RobotHumans Feb 24 '13 at 15:14
@AbrahamVanHelpsing, Yes- but I have found that many people (especially beginners) are using the term pygtk interchangeably. If he is developing an app using quickly, more than likely he's really using pygi. If not, he should migrate anyway – Ian B. Feb 24 '13 at 23:37

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.