Welcome, guest | Sign In | My Account | Store | Cart

Example shows how to unset gtk engine'd look for a particular widget.

gtk.Widget.modify_xx allows you to override simple properties, like backgrounds (unless theme uses an engine) and text color (sometimes (?)) gtkrc allows you to override most properties for all or selected widgets, like sizes, faces, and so on. some parts of widget appearance are set through engine stanzas in gtkrc, these can be unset too, if you know how...

here it is!

Python, 13 lines
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
my_rc = \
"""
style "my button"
{
  engine "" {}
}
widget "*.my button" style "my button"
"""

b = gtk.Button()
b.set_name("my button")
# and now you can...
b.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("pink"))
Created by Dima Tisnek on Mon, 13 Jul 2009 (MIT)
Python recipes (4591)
Dima Tisnek's recipes (11)

Required Modules

  • (none specified)

Other Information and Tasks