[pygtk] Transparent textview background

Dx dx at dxzone.com.ar
Wed Oct 10 02:00:06 WST 2007


Hi there

I'm trying to set a background image to a textview. The.. obvious?
ways to do it (hack expose function, set_back_pixmap, etc) worked..
until I tried it inside a ScrolledWindow, which resulted in many
partial renderings of the same pixmap...

So, to have a fixed background, I have to put that image outside the
ScrolledWindow. But then, I had the textview background. How can I set
a transparent background for a textview?

Things i've tried:

textview.set_style(style)
does nothing with GC changes, black background with color changes..
wtf? Is this a bug?

style.set_background(gdkwindow, gtk.STATE_NORMAL)
sets only the background color, but works

Style changes I've tried:
gc.set_function(gtk.gdk.NOOP)
gc.set_background(gtk.gdk.Color(50,100,150))
style.base_gc[gtk.STATE_NORMAL] = gc
style.bg_gc[gtk.STATE_NORMAL] = gc
style.bg[gtk.STATE_NORMAL] = gtk.gdk.Color(50,100,150)
style.base[gtk.STATE_NORMAL] = gtk.gdk.Color(50,100,150)

...set_back_pixmap(None, True) # black background
...set_back_pixmap(None, False) # normal background

Also some gtkrc change tests, that failed too.

Thanks :D


ps: before anyone asks why do I need this, it's because we need a bit
more powerful html renderer.

-- 
dx


More information about the pygtk mailing list