wx.html2 and a virtual / in-memory filesystem

Does anyone have an example of using wx.html2 with a virtual / in-memory filesystem? I tried translating the C++ docs for wxWebView and despite various approaches – nothing came together. I’m not quite sure where to actually start at this point.

My latest attempt involved me creating a subclass of wx.html2.PyWebViewHandler, but when I try to pass it into WebView.RegisterHandler, I get:

TypeError: in method ‘WebView_RegisterHandler’, expected argument 2 of type ‘wxSharedPtr’

Before I also implemented a wx.FileSystem subclass and made sure it worked / could read files in fine (and it did), but then when I went to pass it to the wx.WebViewFSHandler the docs mentioned, it doesn’t appear to actually exist in wxPython. :frowning:

Soo, any pointers?

Or is this even possible?

–Stephen

Stephen Hansen wrote:

Does anyone have an example of using wx.html2 with a virtual / in-memory
filesystem? I tried translating the C++ docs for wxWebView and despite
various approaches -- nothing came together. I'm not quite sure where to
actually start at this point.

My latest attempt involved me creating a subclass of
wx.html2.PyWebViewHandler, but when I try to pass it into
WebView.RegisterHandler, I get:

TypeError: in method 'WebView_RegisterHandler', expected argument 2 of
type 'wxSharedPtr<wxWebViewHandler >'

Before I also implemented a wx.FileSystem subclass and made sure it
worked / could read files in fine (and it did), but then when I went to
pass it to the wx.WebViewFSHandler the docs mentioned, it doesn't appear
to actually exist in wxPython. :frowning:

Soo, any pointers?

Or is this even possible?

Not yet. Classic wxPython hasn't been taught how to deal with the wxSharedPtr C++ template, and I'm not sure it will ever be. You may want to try it in Phoenix. I don't think I've actually tried it there, but the RegisterHandler method wrapper is implemented and knows how to take a WebViewHandler.

···

--
Robin Dunn
Software Craftsman