Default Background Color of Webview

Hey all! I’m wondering if its possible set the default background color of the html2.Webview widget. I want to launch a page with a black background and avoid having the white flash from the browser prior to the page loading.

Alternatively, I figure I could try rendering the browser off screen and then showing it after the page is loaded. Any idea how I might do that?

I hacked the standalone version of the example from wxPython Demo: (5.9 KB)

In TestPanel.__init__ I added the following calls:




In TestPanel.OnWebViewLoaded I added the following calls:

        if self.current != "about:blank":

It sort of works with the website. It may not work with other sites.

Tested using Python 3.10.12 + wxPython 4.2.1 gtk3 (phoenix) wxWidgets on Linux Mint 21.2