Re: [pygtk] Alpha channels in GtkPixmap

2001-01-11 Thread James Henstridge

Tobias Quinn wrote:
> 
> Hi All,
> 
> I'm having problems using a GtkPixmap to display the icon for an image in
> the Gnome panel. I have created a pixmap using Gimp which is transparent and
> wish to display this as the icon. The problem is that the icon never gets
> displayed with the proper transparency information (alpha channel). I've
> tried various things, the code I currently have is:
> 
> red_im = GdkImlib.Image("red_sphere.png")
> 
> red_im.render()
> pixmap, mask = red_im.get_pixmap()
> pix = gtk.GtkPixmap(pixmap, mask)
> pix.show()
> 
> # when the pix is added to panel app, alpha information is not used...
> 
> I'm using pygtk-0.6.6 and pygnome-*-1.0.53

Well, X doesn't support alpha channels (appart from the simple 1 bit
alpha, which is probably not what you want :)

The panel does client side compositing of the image with the background
image to achieve the alpha blending.  I am not sure how to do this
easily from python / pygtk though.

James.

___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



Re: [pygtk] Alpha channels in GtkPixmap

2001-01-10 Thread Martin Grimme

> I'm having problems using a GtkPixmap to display the icon for an image in

> the Gnome panel. I have created a pixmap using Gimp which is transparent
> and 
> wish to display this as the icon. The problem is that the icon never gets

> displayed with the proper transparency information (alpha channel).

Hello,

I once discovered a similar problem with GdkImlib. It simply did not want
to load the alpha channel. The problem is somehow depending on the
currently installed GTK-theme (weird, I know), where a certain type of
entry has to be.

My simple workaround is this at the beginning of the program:

  rcstring = """
  style "trans" {
engine "pixmap" {}
  }
  class "GtkWindow" style "trans"
  """
  rc_parse_string(rcstring)

It works well for me.

I hope it works for you, too.

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


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk



[pygtk] Alpha channels in GtkPixmap

2001-01-09 Thread Tobias Quinn

Hi All,

I'm having problems using a GtkPixmap to display the icon for an image in 
the Gnome panel. I have created a pixmap using Gimp which is transparent and 
wish to display this as the icon. The problem is that the icon never gets 
displayed with the proper transparency information (alpha channel). I've 
tried various things, the code I currently have is:

red_im = GdkImlib.Image("red_sphere.png")

red_im.render()
pixmap, mask = red_im.get_pixmap()
pix = gtk.GtkPixmap(pixmap, mask)
pix.show()

# when the pix is added to panel app, alpha information is not used...

I'm using pygtk-0.6.6 and pygnome-*-1.0.53

Any help would be much appreciated,
Tobias Quinn.

_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


___
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk