3

I am writing a simple application with Python3, Gtk3 and Webkit2. One of the elements is a webview, but I want the webview to be transparent to the background set for the parent container - in this case a Gtk.Paned in a Gtk.Box where the GtK.Box can optionally have a background image set.

Most of the solutions I've found out there give you a webview that is transparent to the screen/desktop. Like this solution:

This is not quite what I want. Is there any way to choose what webview is transparent to? Or another approach that produces the desired result?

Jadzia626
  • 126
  • 7
  • 1
    The approach with `set_transparent` works (e.g. with a GtkOverlay) but it's not available in WebKit2. – elya5 Oct 05 '17 at 12:27
  • There is no particular reason to use WebKit2 over WebKit in my case. I will give it a try. Thanks! – Jadzia626 Oct 05 '17 at 19:55
  • const webview = new WebKit2.WebView(); webview.set_background_color(new Gdk.RGBA()) worked for me in gjs – umitu Jul 21 '22 at 17:53

1 Answers1

1

Good question, but as far as I know it's not currently possible.

ptomato
  • 56,175
  • 13
  • 112
  • 165