[pygtk] PyGTK - Imlib

Martin Grimme mgrimme@online.de
Fri, 15 Sep 2000 15:18:07 +0200


Hello,

I am currently writing an image viewer with thumbnail browser
(you can get information and the latest version from http://www.pycage.de )
and had a strange experience with Imlib.

When I load graphics containing transparencies (XPM, GIF, PNG) then
Imlib only loads the images without creating the transparency-masks
unless I add the following lines of code to my program or use a
GTK-Theme that contains something similar:

  # set style to make transparent pixmaps possible
  rcstring = """
  style "trans" {
    engine "pixmap" {}
  }
  class "GtkWindow" style "trans"
  """
  gtk.rc_parse_string(rcstring)

Why does Imlib only recognize transparency when having an engine "pixmap"
entry (even an empty one) for windows in the gtkrc?

Is there any way around this? I don't want my program to be dependent on
GTK-Engines.

Please help if you can.

Martin Grimme - http://www.pycage.de