Changing background color of an editable gtk widget
Okay it seems to work fine with labels, entry, objects, but gtkTextView objects appear by default to retain default 'white' background. Tried several methods for changing background using event box, but it appears color or pixmap images are rendered occluded (blocked) by gtkTextView objects background...hmm...still looking for solution on this.
Easy method for changing background with pixmap image with pygtk 2+...should work in gtk3+ as well
winstyle = window.get_style().copy()
pixbuf = gtk.gdk.pixbuf_new_from_file(filepath)
pixmap, mask = pixbuf.render_pixmap_and_mask()
winstyle.bg_pixmap[gtk.STATE_NORMAL] = pixmap
window.set_style(winstyle)
If you are working with glade you can find the widow style by referencing your ui top level window...
for example,
a window called mydialog, would have its style referenced as above using
winstyle = self.ui.mydialog.get_style().copy()
just need to substitute 'self.ui.mydialog' for 'window' above
and 'filepath' refers to path to pixmap file (I typically use .png files).
Sunday, March 25, 2012
Subscribe to:
Post Comments (Atom)
Oblivion
Between the fascination of an upcoming pandemic ridden college football season, Taylor Swift, and Kim Kardashian, wildfires, crazier weathe...
-
For starters, as I've seen (pardon my ignorance if I am incorrect), it seems a common way to use path based animated motion for objects...
-
Okay so if you read into python scripting examples of moving vertices around in Blender, it seems whether using a bpy.context or bpy.data c...
-
Mesh face and vertex count much to high for game mesh and texture here (? possibly) but someday in the future may be found in textures and ...
No comments:
Post a Comment