PYTHON GTK - CSS

PYTHON GTK - CSS

if you need css file for your gui of application, you can do it like that.

first : create a css file. 

#mywidgets.css

GtkWindow {

   background-color: white; }

GtkButton {    color: black;    background: gray; }

GtkLabel { color: red; background: black; }

second: add this to your code, in window.

cssProvider = Gtk.CssProvider()        cssProvider.load_from_path(‘mywidgets.css’)        screen = Gdk.Screen.get_default()        styleContext = Gtk.StyleContext()        styleContext.add_provider_for_screen(screen, cssProvider,                                             Gtk.STYLE_PROVIDER_PRIORITY_USER)