How to apply theme to PyGTK Application

gtk, pygtk, python, themes

Solution

If you download the first package from your link, the one that's labelled "(GTK & Metacity themes)" you should get a tar.gz archive. Unpack the archive into some folder like `/home/jake/.themes`. Then in your pygtk code, before you initialize your widgets(I would do it right after you import pygtk and gtk in your code), add this line:

`gtk.rc_parse('/home/jake/.themes/Elegant Brit/gtk-2.0/gtkrc')`

That `gtkrc` file in that directory contains the information used to tell gtk how to draw the widgets for that theme.

Hope that helps.

Note: Theme choices should be left up to the user and it is generally frowned upon to change/modify the current user's theme when developing an application using gtk.

Problem

Is it possible to apply this GTK+ theme in my PyGTK application? Can I apply the theme programatically? Ie, to apply the theme do I use a PyGTK function or do I have to find where PyGTK is installed on my machine(Inside Python2.7) and change the arrow .pngs, and the scrollbar .pngs and etc.? Note I only have PyGTK installed I dont have GTK+ installed, do I need that? Will the theme linked above work for PyGTK or only for GTK+? Can you provide advice on how I can apply this theme to my PyGTK application?

Original source