|
|
02-18-2008
, 04:33 AM
|
|
Posts: 2,315 |
Thanked: 1,619 times |
Joined on Oct 2005
@ Germany
|
#2
|
|
|
02-19-2008
, 07:32 AM
|
|
Posts: 35 |
Thanked: 5 times |
Joined on Sep 2007
|
#3
|
|
|
02-19-2008
, 07:41 AM
|
|
Posts: 25 |
Thanked: 8 times |
Joined on Feb 2008
|
#4
|
Hi, did you get it working? Can you explain what you did to us?
How would I setup a frame background so that it is semitransparent? I'm thinking about desktop homeitem now. Hmm... I think I have to test what happens when I add labels on that frame box too.
|
|
02-20-2008
, 05:51 AM
|
|
Posts: 35 |
Thanked: 5 times |
Joined on Sep 2007
|
#5
|
|
|
02-20-2008
, 06:20 AM
|
|
|
Posts: 794 |
Thanked: 372 times |
Joined on Jul 2007
@ France
|
#6
|
rgba = gtk.gdk.Screen().get_rgba_colormap()
e.set_colormap(rgba)
|
|
02-20-2008
, 06:34 AM
|
|
Posts: 25 |
Thanked: 8 times |
Joined on Feb 2008
|
#7
|
I tried to fiddle with the transparency too. There are some examples for python applications about it. Though not directly for home applets. What I found out is that in one step I was setting a rgba colormap but that method did not work. Here are few lines as an example:
e = gtk.EventBox()
rgba = gtk.gdk.Screen().get_rgba_colormap()
e.set_colormap(rgba)
So the code breaks on that last line. and the error I get is:
TypeError: GtkWidget.set_colormap() argument 1 must be gtk.gdk.Colormap, not None
So maybe the colormap methods are not ready or that particular way of coding cannot be applied in this context. I don't know.
Returns : a gtk.gdk.Colormap for use with windows with an alpha channel or None if the capability is not available.
|
|
02-20-2008
, 08:46 AM
|
|
Posts: 35 |
Thanked: 5 times |
Joined on Sep 2007
|
#8
|
ok. I tried it as you said:|
|
02-20-2008
, 10:18 AM
|
|
|
Posts: 794 |
Thanked: 372 times |
Joined on Jul 2007
@ France
|
#9
|
|
|
02-20-2008
, 05:01 PM
|
|
Posts: 25 |
Thanked: 8 times |
Joined on Feb 2008
|
#10
|
However, I'm not getting anywhere in actually making it work. Here's my best guess (in Python):
PixBuf = gtk.gdk.pixbuf_new_from_file("image.png") Image = gtk.image_new_from_pixbuf(PixBuf) Button = gtk.Button() Button.set_image(Image) MapMask = PixBuf.render_pixmap_and_mask() Mask = MapMask[1] self.add(Button) Button.shape_combine_mask(Mask, 0, 0) Button.show() self.show()Thanks!