python - How get string selection in wx.html.htmlwindow -
I can not find any method to manage Clopboard from context menu I'm trying with wxpython version 2.8
import wx import wx.lib.iewin class main (wx.frame): def __init __ (self, parent): wx.frame .__ init__ (self, guardian, id, Title, position, size, style) self.html_field = HTMLWINDOW (self.p_html, -1) class HTMLWINDOW (wx.html. HTMLWindow): def __init __ (self, guardian, id): self.ie = wx.lib. Iewin.IEHtmlWindow (self, -1, style) self Def (wx.EVT_CONTEXT_MENU, menu itself) def menu (self, event): self.copied = self.ie.getStringSelection ()
alternative method but only I can get the word I'm not a complete selection
def OnCellClicked (self, cell, x, y, eut): If iStance (cell, wx.html. HTMLWordCell): sel = wx HTML HTML selection () word = cell.ConvertToTest (SEL) Super (MILHILLWINDOWO, itself) .OnCellClicked (cell, X, Y, EUT)
import wx.lib. I get this error
traceback (most recent call final): Value: _type_ 'v' is not supported File "main.py", line 3959, & lt; Module & gt; Import the file as "wux.lib.iewin" in the file "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/lib/iewin.py", in line 15, in the & lt; Module & gt; Import the wx.lib.activex file "/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/lib/activex.py", in line 35, in the & lt; Module & gt; Import the file as "/usr/lib/python2.7/ctypes/wintypes.py" ctypes.wintypes, line 23, & lt; Module & gt; Class VARIANT_BOOL (_SimpleCData): value error: _type_ 'v' not supported
Werner's As already mentioned, you are trying to import wx.lib.iewin
in Linux. The module is Windows only, I think it should give an import error that tells you that it is only Windows, but its name only means that you can put a bug ticket so that it is a Increase the appropriate error.
If you need a browser-like widget, you should see the webview. It was added to wxPython 2.9, I believe and cross-platform works. You can read more about that widget here:
Comments
Post a Comment