The following simple example fails to set the background color of Button
objects.  If I change "Button" to "GtkButton" in the style string and
instantiate a gtk.GtkButton it works.

    import gtk

    class Button(gtk.GtkButton):
        pass

    gtk.rc_parse_string('''
    style "buttonbg"
      {
        bg[NORMAL] = { 0.85, 0.50, 0.50 }
      }
    class "Button" style "buttonbg"
    ''')

    window = gtk.GtkWindow(gtk.WINDOW_TOPLEVEL)

    close = Button("quit")
    close.connect("clicked", gtk.mainquit)
    window.add(close)

    window.show_all()

    gtk.mainloop()

I believe I encountered this in the context of the GtkDrawingArea at one
point.  Any ideas why style settings don't seem to work with subclasses of
Gtk widgets?

Thx,

-- 
Skip Montanaro ([EMAIL PROTECTED])
http://www.mojam.com/
http://www.musi-cal.com/
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to