I haven't taught SWIG how to deal with that wxSharedPtr template yet.
···
On 8/9/12 12:10 PM, Josh Ghiloni wrote:
When attempting to use a custom WebViewHandler in wxPython 2.9.4.0, I'm
getting an error that leads me to believe that maybe there's a casting
error I don't fully understand. Here's my code:
When I attempt to start the script, I get:
$ python notefs-login.py
Traceback (most recent call last):
File "notefs-login.py", line 72, in <module>
win = LoginWindow()
File "notefs-login.py", line 60, in __init__
win = BrowserPanel(self, self)
File "notefs-login.py", line 29, in __init__
wv.RegisterHandler(WebViewMemoryHandler())
File "/usr/local/lib/python2.7/dist-packages/wx/html2.py", line 164,
in RegisterHandler
return _html2.WebView_RegisterHandler(*args, **kwargs)
TypeError: in method 'WebView_RegisterHandler', expected argument 2 of
type 'wxSharedPtr<wxWebViewHandler >'
Thanks for the info Robin. I’ve worked around it for now by dumping the string into a temp file, which I display using the file:// protocol and delete when the app closes.
···
On Friday, August 10, 2012 10:26:45 AM UTC-6, Robin Dunn wrote:
On 8/9/12 12:10 PM, Josh Ghiloni wrote:
When attempting to use a custom WebViewHandler in wxPython 2.9.4.0, I’m
getting an error that leads me to believe that maybe there’s a casting
error I don’t fully understand. Here’s my code:
When I attempt to start the script, I get:
$ python notefs-login.py
Traceback (most recent call last):
File “notefs-login.py”, line 72, in
win = LoginWindow()
File “notefs-login.py”, line 60, in init
win = BrowserPanel(self, self)
File “notefs-login.py”, line 29, in init
wv.RegisterHandler(WebViewMemoryHandler())
File “/usr/local/lib/python2.7/dist-packages/wx/html2.py”, line 164,
Is there a timeline on getting this functionality to work? I’d like to be able to link to external stylesheets and Javascript files from within my pages and handle them with a MemoryFSHandler, and currently I’m just inserting those into the html page using a find/replace and then using SetPage.
Alternatively, can you point me in the right direction for implementing this functionality? I’ve never worked with SWIG before, but I might be able to poke around and figure it out if you don’t have the time right now to work on this.
Thanks
···
On Friday, August 10, 2012 5:12:33 PM UTC-6, Josh Ghiloni wrote:
Thanks for the info Robin. I’ve worked around it for now by dumping the string into a temp file, which I display using the file:// protocol and delete when the app closes.
On Friday, August 10, 2012 10:26:45 AM UTC-6, Robin Dunn wrote:
On 8/9/12 12:10 PM, Josh Ghiloni wrote:
When attempting to use a custom WebViewHandler in wxPython 2.9.4.0, I’m
getting an error that leads me to believe that maybe there’s a casting
error I don’t fully understand. Here’s my code:
When I attempt to start the script, I get:
$ python notefs-login.py
Traceback (most recent call last):
File “notefs-login.py”, line 72, in
win = LoginWindow()
File “notefs-login.py”, line 60, in init
win = BrowserPanel(self, self)
File “notefs-login.py”, line 29, in init
wv.RegisterHandler(WebViewMemoryHandler())
File “/usr/local/lib/python2.7/dist-packages/wx/html2.py”, line 164,
I’ve got no idea, but I did a lot of experimenting with cefpython a few months back, it has one or two wxPython examples. If I knew CSS better, I likely would have just embedded cefpython in a wxPython Frame and made my GUI layout using HTML… it turned out that wxPython layout by hand is easier for me than CSS. More recently I embedded a cefpython in a wxPython GUI where I was injecting javascript into a webpage, and it worked pretty well.
···
On Tuesday, October 21, 2014 8:14:51 AM UTC-7, TC wrote:
On Friday, August 10. 2012 18:26:45 UTC+2 Robin Dunn wrote:
I haven’t taught SWIG how to deal with that wxSharedPtr template yet.
Hello, I am facing the same issue with wx 3.0.2. Is there any chance this will work one day or shall I try to work around? Thanks!
Thank you for your suggestion. However, I would like to avoid cefpython if possible. We embedded Webkit GTK into our wx application with wx 2.8 and now I am trying to migrate this code to wx.WebView for wx 3.0. Everithing seems fine, except for our custom resource handling. We used the event ‘resource-request-starting’ of the Webkit GTK API for that. I suppose wx.WebView.RegisterHandler() should do the same job considering the resources I need to handle this way have a special ‘resource:’ scheme in the URL.
I also tried handling EVT_WEBVIEW_NAVIGATING, but this event is only called for the main document (the HTML page), not the resources within it (images, css, scripts). I need to be able to serve these resources from the database or generate them on the fly, so I can’t serve them through file:/// or similar URI. wx.WebView.RegisterHandler() seems to be the only suitable way.
Does anyone have any suggestions how to use wx.WebView.RegisterHandler() within Python?
Or would the Phoenix project be the solution?
I suppose working with the native backend through wx.WebVioew.GetNativeBackend() would not give any better results within Python. Is that right?
``