I've got 2 scrollbar (horizontal and vertical) widgets in my pygtk app. As you know the scrollbars have current gtk theme style by default. I want to use my own css style for gtk scrollbars only in my app. There is a tutorial here http://thegnomejournal.wordpress.com/2011/03/15/styling-gtk-with-css/ But there is no information about how to use css files that we created in a pygtk application.
How can i do this?
style_provider = Gtk.CssProvider() css = open('/path/to/your/style.css'), 'rb') # rb needed for python 3 support css_data = css.read() css.close() style_provider.load_from_data(css_data) Gtk.StyleContext.add_provider_for_screen( Gdk.Screen.get_default(), style_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION )
Add theese codes into your app.py to use a personal css file. The new values in your css file will be overwritten to system general styles.