Transparent window (alpha support)

Hello everyone,
i use gtk::windows with various content(child) widgets like

#gstreamer widget
class SimpleVideoWidget < Gtk::DrawingArea

end

#image widget
class SimpleImageWidget < Gtk::Image

end

#html widget
class WebkitWidget < Gtk::WebKit::WebView

end

now i want to set them transparent.

i found some cairo samples but im not sure if the are right for me
http://www.pri.univie.ac.at/~mangler/alphademo/alphademo.rb

my composite manager is enabled
Gdk::Screen.default.composited? is true
and here i get the rgba colormap
Gdk::Screen.default.rgba_colormap

do i have to use gtk:window#.input_shape_combine_mask(,0,0)?

does anyone have any hints ?

thanks ahead

Philipp

does anyone have any hints ?

ruby-gnome2/trunk/gtk/sample/misc/composited-windows.rb might be a
good startting point.


Guillaume C. - http://zarb.org/~gc/

Hello Guillaume,

thanks for the information …

got it to work. if composite is enabled u can use
gtk::window#set_opacity()

alpha must be between 0 an 1

e.g
@fraticles["#{fraticle[‘id’]}"].signal_connect_after(‘map-event’) do
|widget, event|
widget.window.set_opacity(0.8)

end

i think its also important where u call the functions because sometimes
alpha was set for a window but it was not transparent … got best
results with the map-event

regards
Philipp

On Mon, May 19, 2008 at 1:06 AM, Philipp G.
[email protected] wrote:

e.g
@fraticles["#{fraticle[‘id’]}"].signal_connect_after(‘map-event’) do
|widget, event|
widget.window.set_opacity(0.8)

end

i think its also important where u call the functions because sometimes
alpha was set for a window but it was not transparent … got best
results with the map-event

I don’t understand fully what you’re saying: do you imply that the
mentioned example should be fixed? Can you provide a patch if that’s
the case? Or do you mean there is another way to do the same thing?
Can you program a short demo program if that’s the case?


Guillaume C. - http://zarb.org/~gc/

Hello Guillaume,
im not sure if this is a bug, or my fault

i loop through a xml and create 1-5 windows … after 10-20 secs the
windows will be destroyed and i create new windows …

here my code to create the window

xml_fraticles.find(‘fraticle’).each{|fraticle|
@fraticles["#{fraticle[‘id’]}"] = Gtk::Window.new
@fraticles["#{fraticle[‘id’]}"].screen =
Gdk::DisplayManager.get.default_display.get_screen
fraticle[‘x11screen’].to_i
@fraticles["#{fraticle[‘id’]}"].move(fraticle[‘left’].to_i,fraticle[‘top’].to_i)
@fraticles["#{fraticle[‘id’]}"].resize(fraticle[‘width’].to_i,fraticle[‘height’].to_i)
@fraticles["#{fraticle[‘id’]}"].decorated = false
fraticles["#{fraticle[‘id’]}"].add
eval(fraticle[‘playermodule’]).new(self, fraticle)
@fraticles["#{fraticle[‘id’]}"].set_opacity(0.8)
<<<<<<<<<<<<<<<<<<<<<< if i call it here only a few windows are
transparent
@fraticles["#{fraticle[‘id’]}"].signal_connect_after(‘map-event’) do
|widget, event|
widget.window.set_opacity(0.8)<<<<<<<<<< if i call i here
its working for all windows
end
}

hi:

I am trying use the set_sort_func from the sortable interface for
liststore or for a column in a treeview.

By now i can order columns like this:
column.set_sort_column_id(3)

This works but i can not have my own set_sort_func

or,

@list_store_productos.set_sort_column_id(3)
@list_store_productos.set_sort_func(3){|iter1,iter2|

}

But this fail to me.

Any ideas?

Hi,

In [email protected]
“[ruby-gnome2-devel-en] set_sort_func” on Thu, 22 May 2008 14:21:12
+0200,
“Martin (OpenGeoMap)” [email protected] wrote:

@list_store_productos.set_sort_column_id(3)
@list_store_productos.set_sort_func(3){|iter1,iter2|

}

But this fail to me.

Could you show us your example script that is executable?

Thanks,

kou

ok code is ugly, one more try

http://pastie.caboo.se/199410

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs