Question

I tried the following, yet the button still has a white background:

    self.button = gtk.CheckButton()
    self.button.modify_fg(gtk.STATE_NORMAL, gtk.gdk.Color(65535,0,0))
    self.button.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(65535,0,0))
    self.button.modify_fg(gtk.STATE_ACTIVE, gtk.gdk.Color(65535,0,0))
    self.button.modify_bg(gtk.STATE_ACTIVE, gtk.gdk.Color(65535,0,0))
    self.button.modify_fg(gtk.STATE_PRELIGHT, gtk.gdk.Color(65535,0,0))
    self.button.modify_bg(gtk.STATE_PRELIGHT, gtk.gdk.Color(65535,0,0))
    self.button.modify_fg(gtk.STATE_SELECTED, gtk.gdk.Color(65535,0,0))
    self.button.modify_bg(gtk.STATE_SELECTED, gtk.gdk.Color(65535,0,0))
    self.button.modify_fg(gtk.STATE_INSENSITIVE, gtk.gdk.Color(65535,0,0))
    self.button.modify_bg(gtk.STATE_INSENSITIVE, gtk.gdk.Color(65535,0,0))

I also added the CheckButton to an EventBox, and changed the color of that, but all it did is set the background of the space around the button - the button itself was still w/ a white background.

Was it helpful?

Solution

So you want the part with the check mark on it to be a different color? Then use this button.modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse("red")).

alt text http://www.ubuntu-pics.de/bild/22793/screenshot_009_MCxjbu.png

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top