I have a GTK ui that has a gtkVBox that gets gtkHbox's containing content dynamically added to it as the user works.
The ui is getting crowded and it's difficult to tell what Hbox the components belong to (they repeat.)
I would like to alter the background color of the gtkHboxes so it alternates between a lighter and darker color for each one.
Basically, I'm creating a dynamic table of combo boxes where each row represents an object. Now I need to segment the rows since they are quiet complex and hard to follow.
Thanks, Dave.
According to the docs, since hboxes "do not have an associated window", you can not directly modify the background color. The docs suggest to wrap it in and event box. This works quite well:
hbox = gtk.HBox()
eb = gtk.EventBox()
eb.add(hbox)
eb.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(red=65535))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With