How to overlay transparent buttons on top of Gtk.drawingarea

I created Gtk.grid, which contains a bunch of buttons that resize and drag around the grid.

I also created Gtk.drawingarea, which draws grid lines. I want to make my buttons transparent:

Gtk.Button.set_property("opacity", 0.3)

This makes the buttons transparent; however, this does not allow me to see the grid of lines behind the buttons.

I know that I overlay them correctly on the Gtk.Overlay widget, because some of the lines that are not directly behind the buttons are displayed correctly.

My question is, how can I see the rest of the drawing area that REQUESTS the transparent buttons? I tried to adjust the transparency of the containers by setting the transparency of Gdk.Window, nothing works. Is this something that is not possible with Gtk3?

+3
source share
1 answer

Well, I don’t know why I haven’t tried this before. The answer is to set the opacity property in the Gtk.Overlay widget.

Gtk.Overlay.set_property("opacity", 0.5)
+4
source

All Articles