title: Why css style don't work on GtkButton?
body: <p>Please excuse my english.</p>
  
  <p>I'm trying to change the background color of a GtkButton using a css file but I can't.
  I tried a few examples I found on the web, but none work.
  I post two examples. One in Python 3.2.3 and the other in C
  I'm using Gtk+ 3.6 and Kubuntu 12.10.</p>
  
  <p>This is the code of one of them:</p>
  
  <pre><code>from gi.repository import Gtk, Gdk
  
  class MainWindow(Gtk.Window):
      def __init__(self):
          super().__init__()
          vbox = Gtk.Box(spacing=10,orientation=Gtk.Orientation.VERTICAL)
          self.add(vbox)
  
          self.entries = [ Gtk.Entry() for i in range(3) ]
          for e in self.entries:
              vbox.pack_start(e, True, True, 0)
              e.connect("changed", self.on_entry_changed)
              e.set_text('123')
  
          button=Gtk.Button(label='ok')
          vbox.pack_end(button,True,True,0)
  
      def on_entry_changed(self,entry):
          ctx = entry.get_style_context()
          if not entry.get_text().isnumeric():
              ctx.add_class('invalid')
          else:
              ctx.remove_class('invalid')
  cssProvider = Gtk.CssProvider()
  cssProvider.load_from_path('style.css')
  screen = Gdk.Screen.get_default()
  styleContext = Gtk.StyleContext()
  styleContext.add_provider_for_screen(screen, cssProvider,
  Gtk.STYLE_PROVIDER_PRIORITY_USER) # With the others GTK_STYLE_PROVIDER_PRIORITY values get the same result.
  
  window = MainWindow()
  window.connect("delete-event", Gtk.main_quit)
  window.show_all()
  Gtk.main()
  </code></pre>
  
  <p>and the style.css</p>
  
  <pre><code>GtkEntry.invalid {
      background-color: #ffaaaa;
      background: #ffaaaa;
  }
  
  GtkButton {
      engine: oxygen-gtk; /*tried also with 'none' and without setting engine*/
      background-color: green;
      background: green;
  }
  </code></pre>
  
  <p>The entries works well... the bg color change. But the Button no, and theres no error         messages.</p>
  
  <p><b>EDIT3:</b> (Deleted previews edits and change some tags)
  <b>Summarizing...</b> I tried to change the button color with all the Python, C, and C++ codes I found in the web unsuccessfully. I read all the tutorials I found and the GTK+ 3 reference manual. 
  All that I know after that is that the problem is about Kubuntu themes: If I change the GTK theme from <em>'oxygen-gtk'</em> to <em>'default'</em> (in GTK Configuration), is the only way I found that the code works well, but this is not the idea and the button looks horrible.</p>
  
  <p><b>So, the questions are:</b></p>
  
  <ol>
  <li>Why I can't change the background color of the button?</li>
  <li>Why I having this problem only with buttons? (Works well with other widgets)</li>
  <li>I get answers here and in GTK forums saying that is not a good practice to change button colors, but... What if I want a menu like the one in this image (<a href="http://c.fsdn.com/con/app/proj/scrmopenerp/screenshots/ProjetatyScrmOpenerp_2.png" rel="nofollow">link</a>) (see red box buttons)? Wich is the best practis for that?</li>
  </ol>
  
  <p>Thanks and greetings!</p>