sugarmuff
sugarmuff

Reputation: 435

How to overlay transparent buttons on top of Gtk.drawingarea

I have created a Gtk.grid which contains a bunch of buttons that are resizable and draggable around the grid.

I have also created a Gtk.drawingarea which draws grid lines. I wish to make my buttons transparent like so:

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

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

I know that I am overlaying them correctly with a Gtk.Overlay widget, because a portion of the lines that are not directly behind the buttons are displayed properly.

My question is, how can I see the rest of the drawing area which is BEHIND the transparent buttons? I have tried setting the containers to be transparent, setting the Gdk.Window transparency, nothing is working. Is this just something that is not possible with Gtk3?

Upvotes: 3

Views: 2006

Answers (1)

sugarmuff
sugarmuff

Reputation: 435

Well, I don't know why I never tried this before. The answer is to set the opacity property on the Gtk.Overlay widget itself.

Gtk.Overlay.set_property("opacity", 0.5)

Upvotes: 5

Related Questions