python:wxpython

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
次のリビジョン両方とも次のリビジョン
python:wxpython [2020/02/03 12:55] – [wxPython] ともやんpython:wxpython [2020/03/10 12:20] – [wxPython] ともやん
行 1: 行 1:
 +<html>
 +  <style>
 +    #result pre {
 +      overflow: scroll;
 +      overflow-x: hidden;
 +      font-size: 12px;
 +    }
 +    #result_long pre {
 +      height: 300px;
 +      overflow: scroll;
 +      overflow-x: hidden;
 +      font-size: 12px;
 +    }
 +    #source_code pre {
 +      overflow: scroll;
 +      overflow-x: hidden;
 +      font-size: 12px;
 +    }
 +  </style>
 +</html>
 ====== wxPython ====== ====== wxPython ======
 {{:python:wxpython_logo.png?309|wxPython Logo}}\\ {{:python:wxpython_logo.png?309|wxPython Logo}}\\
行 9: 行 29:
 ・[[https://sourceforge.net/projects/wxpython/files/wxPython/|wxPython - Browse /wxPython at SourceForge.net]] (wxPython Classic 3系)\\ ・[[https://sourceforge.net/projects/wxpython/files/wxPython/|wxPython - Browse /wxPython at SourceForge.net]] (wxPython Classic 3系)\\
 \\ \\
- wxPythonは、wxWidgets C++ クラス ライブラリ(クロス プラットフォーム GUIライブラリ)のPython言語向けバインディングである。つまり、PythonからwxWidgetsを利用できるようにしたものである。\\ + wxPythonは、wxWidgets C++ クラス ライブラリ(クロス プラットフォーム GUI ライブラリ)の Python 言語向けバインディングである。つまり、Python から wxWidgets を利用できるようにしたものである。\\ 
- wxPythonを使いPythonでプログラムを記述すると、スクリプト言語でGUIアプリケーションを作成できる。さらに、そのプログラムはLinuxやWindows、Mac OS Xで同じように動作する。(PythonとwxPythonが利用できる様々なプラットフォームで動作する。)+ wxPython を使い Python でプログラムを記述すると、スクリプト言語で GUI アプリケーションを作成できる。さらに、そのプログラムは Linux や Windows、Mac OS Xで同じように動作する。(Python と wxPython が利用できる様々なプラットフォームで動作する。) 
 + 
 +===== インストール ===== 
 +**wxPython Phoenix 4**系\\ 
 +<code powershell> 
 +PS > pip install wxpython 
 +</code> 
 +<WRAP prewrap 100% #result> 
 +<code> 
 +Collecting wxpython 
 +  Downloading wxPython-4.0.7.post2-cp38-cp38-win_amd64.whl (22.9 MB) 
 +     |████████████████████████████████| 22.9 MB 819 kB/s 
 +Collecting six 
 +  Downloading six-1.14.0-py2.py3-none-any.whl (10 kB) 
 +Collecting numpy; python_version >= "3.0" 
 +  Downloading numpy-1.18.1-cp38-cp38-win_amd64.whl (12.8 MB) 
 +     |████████████████████████████████| 12.8 MB 1.3 MB/s 
 +Collecting pillow 
 +  Downloading Pillow-7.0.0-cp38-cp38-win_amd64.whl (2.0 MB) 
 +     |████████████████████████████████| 2.0 MB 1.3 MB/s 
 +Installing collected packages: six, numpy, pillow, wxpython 
 +Successfully installed numpy-1.18.1 pillow-7.0.0 six-1.14.0 wxpython-4.0.7.post2 
 +</code> 
 +</WRAP>
  
 ===== ビルドする場合 ===== ===== ビルドする場合 =====
 +
 +==== wxPython Classic 3系 ====
 フォルダ構成を以下のようにする。\\ フォルダ構成を以下のようにする。\\
 ^ build_folder ^^ ^ build_folder ^^
行 32: 行 77:
 > cd wxWidgets > cd wxWidgets
 > git checkout -f v3.0.2 > git checkout -f v3.0.2
 +> git submodule update --init
 +> git status
 +HEAD detached at v3.0.2
 +nothing to commit, working tree clean
 </code> </code>
  
行 48: 行 97:
 予め [[http://aka.ms/vcpython27|Microsoft Visual C++ Compiler Pack for Python 2.7]] のインストールが必要である。\\ 予め [[http://aka.ms/vcpython27|Microsoft Visual C++ Compiler Pack for Python 2.7]] のインストールが必要である。\\
 <code> <code>
-> cd wxPython-Classic +> cd wxPython-Classic\wxPython
-> "%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" +
-Setting environment for using Microsoft Visual Studio 2008 x86 tools.+
 </code> </code>
  
 x32 ビルド\\ x32 ビルド\\
 <code> <code>
-> set CPU= +> "%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" x86 
-python build-wxpython.py+Setting environment for using Microsoft Visual Studio 2008 x86 tools. 
 +> set CPU=x86 
 +py -2 build-wxpython.py
 </code> </code>
 x64 ビルド\\ x64 ビルド\\
 <code> <code>
-> set CPU=X64 +> "%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" x64 
-python build-wxpython.py+Setting environment for using Microsoft Visual Studio 2008 x64 tools. 
 +> set CPU=x64 
 +py -2 build-wxpython.py 
 +</code> 
 + 
 +==== wxPython Phoenix 4系 ==== 
 +フォルダ構成を以下のようにする。\\ 
 +^ build_folder ^^ 
 +| + ^ wxWidgets ^ 
 +| + ^ wxPython-Phoenix ^ 
 + 
 +<code> 
 +> git clone https://github.com/wxWidgets/Phoenix.git wxPython-Phoenix 
 +> cd wxPython-Phoenix 
 +> "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.16 
 +********************************************************************** 
 +** Visual Studio 2019 Developer Command Prompt v16.4.5 
 +** Copyright (c) 2019 Microsoft Corporation 
 +********************************************************************** 
 +[vcvarsall.bat] Environment initialized for: 'x64' 
 +> echo %VCToolsVersion% 
 +14.16.27023 
 +> git submodule update --init --recursive 
 +</code> 
 + 
 +==== トラブルシューティング ==== 
 + 
 +=== link.EXE : return code '0x458' が発生する場合 === 
 +**vcvarsall.bat** の引数 **x86/x64** を適切に指定する。\\ 
 +<code> 
 +> "%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" x86 
 +Setting environment for using Microsoft Visual Studio 2008 x86 tools. 
 +</code> 
 +or 
 +<code> 
 +> "%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" x64 
 +Setting environment for using Microsoft Visual Studio 2008 x64 tools.
 </code> </code>
  
-==== error: Microsoft Visual C++ 9.0 is required. が発生する場合 ====+=== error: Microsoft Visual C++ 9.0 is required. が発生する場合 ===
 以下のエラーが発生する場合\\ 以下のエラーが発生する場合\\
 <code> <code>
行 78: 行 163:
 </code> </code>
  
-==== error: Unable to find vcvarsall.bat が発生する場合 ====+=== error: Unable to find vcvarsall.bat が発生する場合 ===
 以下のエラーが発生する場合\\ 以下のエラーが発生する場合\\
 <code> <code>
行 90: 行 175:
 Test\\ Test\\
 <code pyhton> <code pyhton>
-python+py -2
 Python 2.7.17 (v2.7.17:c2f86d86e6, Oct 19 2019, 21:01:17) [MSC v.1500 64 bit (AMD64)] on win32 Python 2.7.17 (v2.7.17:c2f86d86e6, Oct 19 2019, 21:01:17) [MSC v.1500 64 bit (AMD64)] on win32
 Type "help", "copyright", "credits" or "license" for more information. Type "help", "copyright", "credits" or "license" for more information.
 >>> from distutils.msvccompiler import get_build_version >>> from distutils.msvccompiler import get_build_version
->>> get_build_version()+>>> version = get_build_version() 
 +>>> version
 9.0 9.0
 >>> from distutils.msvc9compiler import * >>> from distutils.msvc9compiler import *
->>> find_vcvarsall(9.0+>>> find_vcvarsall(version
->>> query_vcvarsall(9.0"x64")+>>> query_vcvarsall(version'x64')
 Traceback (most recent call last): Traceback (most recent call last):
   File "<stdin>", line 1, in <module>   File "<stdin>", line 1, in <module>
-  File "c:\python27\Lib\distutils\msvc9compiler.py", line 271, in query_vcvarsall+  File "C:\Python27\lib\distutils\msvc9compiler.py", line 271, in query_vcvarsall
     raise DistutilsPlatformError("Unable to find vcvarsall.bat")     raise DistutilsPlatformError("Unable to find vcvarsall.bat")
 distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat
 >>> from setuptools import setup >>> from setuptools import setup
->>> find_vcvarsall(9.0) +>>> from distutils.msvc9compiler import * 
->>> query_vcvarsall(9, "x64"+>>> find_vcvarsall(version
-{u'path': u'C:\\Users\\tomoyan\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64;C:\\Users\\tomoyan\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\WinSDK\\Bin\\x64;C:\\Users\\tomoyan\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\WinSDK\\Bin;C:\\Users\\tomoyan\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin;c:\\devenv\\py27wx\\Scripts;C:\\Python38\\;C:\\Python38\\Scripts\\;C:\\Python27\\Scripts\\;C:\\vstools;C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.1\\bin;C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.1\\libnvvp;%JDK_HOME%\\bin;C:\\Program Files\\PostgreSQL\\11\\bin;C:\\Tools\\pciutils;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files\\Android\\android-sdk-windows\\platform-tools;C:\\Program Files (x86)\\Skype\\Phone\\;C:\\Program Files\\PostgreSQL\\9.3\\bin\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\Microsoft SQL Server\\130\\Tools\\Binn\\;C:\\Tools\\sakura;C:\\Tools\\WinMerge;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\Program Files\\NVIDIA Corporation\\Nsight Compute 2019.3.0\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\170\\Tools\\Binn\\;C:\\Program Files\\TortoiseGit\\bin;C:\\Program Files\\TortoiseHg\\;C:\\Program Files (x86)\\QuickTime\\QTSystem\\;C:\\Program Files\\LLVM\\bin;C:\\Program Files\\CMake\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files (x86)\\IncrediBuild;C:\\DevTools\\gettext-iconv\\gettext-iconv\\bin;C:\\Users\\tomoyan\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\tomoyan\\.dotnet\\tools;%USERPROFILE%\\AppData\\Local\\Microsoft\\WindowsApps', +u'C:\\Users\\tomoyan\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\vcvarsall.bat'
- +
- u'include': u'C:\\Users\\tomoyan\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Include;C:\\Users\\tomoyan\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\WinSDK\\Include;C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.1\\include', +
- +
- u'lib': u'C:\\Users\\tomoyan\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Lib\\amd64;C:\\Users\\tomoyan\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\WinSDK\\Lib\\x64;C:\\Users\\tomoyan\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Lib;C:\\Users\\tomoyan\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\WinSDK\\Lib;C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v10.1\\lib\\x64', +
- +
- u'libpath': u'C:\\Users\\tomoyan\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Lib\\amd64;C:\\Users\\tomoyan\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\WinSDK\\Lib\\x64;C:\\Users\\tomoyan\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Lib;C:\\Users\\tomoyan\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\WinSDK\\Lib'}+
 >>> ^Z >>> ^Z
 </code> </code>
行 124: 行 204:
 [[https://stackoverflow.com/questions/9233118/library-abi-compatibility-between-versions-of-visual-studio|c++ - Library ABI compatibility between versions of Visual Studio - Stack Overflow]]\\ [[https://stackoverflow.com/questions/9233118/library-abi-compatibility-between-versions-of-visual-studio|c++ - Library ABI compatibility between versions of Visual Studio - Stack Overflow]]\\
  
-===== 最小wxPythonアプリケーション ===== +==== distutils.msvccompiler の get_build_version() の実装 (Python 3.8) ==== 
-[PyWxHelloMain] - UTF-8で保存すること。+<WRAP prewrap 100% #result>
 <code python> <code python>
 +def get_build_version():
 +    """Return the version of MSVC that was used to build Python.
 +
 +    For Python 2.3 and up, the version number is included in
 +    sys.version.  For earlier versions, assume the compiler is MSVC 6.
 +    """
 +    prefix = "MSC v."
 +    i = sys.version.find(prefix)
 +    if i == -1:
 +        return 6
 +    i = i + len(prefix)
 +    s, rest = sys.version[i:].split(" ", 1)
 +    majorVersion = int(s[:-2]) - 6
 +    if majorVersion >= 13:
 +        # v13 was skipped and should be v14
 +        majorVersion += 1
 +    minorVersion = int(s[2:3]) / 10.0
 +    # I don't think paths are affected by minor version in version 6
 +    if majorVersion == 6:
 +        minorVersion = 0
 +    if majorVersion >= 6:
 +        return majorVersion + minorVersion
 +    # else we don't know what version of the compiler this is
 +    return None
 +</code>
 +</WRAP>
 +<WRAP prewrap 100% #result>
 +<code python>
 +>>> from distutils.msvccompiler import get_build_version
 +>>> version = get_build_version(); version
 +14.1
 +>>> import sys
 +>>> sys.version
 +'3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 23:11:46) [MSC v.1916 64 bit (AMD64)]'
 +>>> s[:-2]
 +'19'                                                                                                                    >>> majorVersion = int(s[:-2]) - 6
 +>>> majorVersion
 +13                                                                                                                      >>> majorVersion += 1
 +>>> majorVersion
 +14
 +>>> s[2:3]
 +'1'
 +>>> minorVersion = int(s[2:3]) / 10.0
 +>>> minorVersion
 +0.1
 +>>> majorVersion + minorVersion
 +14.1
 +</code>
 +</WRAP>
 +
 +==== distutils.msvc9compiler の find_vcvarsall() の実装 (Python 3.8) ====
 +<WRAP prewrap 100% #result>
 +<code python>
 +def find_vcvarsall(version):
 +    """Find the vcvarsall.bat file
 +
 +    At first it tries to find the productdir of VS 2008 in the registry. If
 +    that fails it falls back to the VS90COMNTOOLS env var.
 +    """
 +    vsbase = VS_BASE % version
 +    try:
 +        productdir = Reg.get_value(r"%s\Setup\VC" % vsbase,
 +                                   "productdir")
 +    except KeyError:
 +        log.debug("Unable to find productdir in registry")
 +        productdir = None
 +
 +    if not productdir or not os.path.isdir(productdir):
 +        toolskey = "VS%0.f0COMNTOOLS" % version
 +        toolsdir = os.environ.get(toolskey, None)
 +
 +        if toolsdir and os.path.isdir(toolsdir):
 +            productdir = os.path.join(toolsdir, os.pardir, os.pardir, "VC")
 +            productdir = os.path.abspath(productdir)
 +            if not os.path.isdir(productdir):
 +                log.debug("%s is not a valid directory" % productdir)
 +                return None
 +        else:
 +            log.debug("Env var %s is not set or invalid" % toolskey)
 +    if not productdir:
 +        log.debug("No productdir found")
 +        return None
 +    vcvarsall = os.path.join(productdir, "vcvarsall.bat")
 +    if os.path.isfile(vcvarsall):
 +        return vcvarsall
 +    log.debug("Unable to find vcvarsall.bat")
 +    return None
 +</code>
 +</WRAP>
 +<WRAP prewrap 100% #result>
 +<code python>
 +</code>
 +</WRAP>
 +
 +===== 最小のwxPythonアプリケーション =====
 +UTF-8で保存すること。
 +<WRAP prewrap 100% #source_code>
 +<code python PyWxHelloMain.py>
 #!/usr/bin/env python #!/usr/bin/env python
 # -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
- 
 import wx import wx
  
-# PyWxHelloFrameクラス(wxFrameから派生)+# PyWxHelloFrame クラス(wxFrame から派生)
 class PyWxHelloFrame(wx.Frame): class PyWxHelloFrame(wx.Frame):
     def __init__(self, *args, **kwds):     def __init__(self, *args, **kwds):
         wx.Frame.__init__(self, *args, **kwds)         wx.Frame.__init__(self, *args, **kwds)
-        # Panel生成+        # Panel 生成
         panel = wx.Panel(self, -1)         panel = wx.Panel(self, -1)
-        # Panelに[閉じる]ボタンを追加+        # Panel に [閉じる] ボタンを追加
         btnClose = wx.Button(panel, wx.NewId(), u"閉じる")         btnClose = wx.Button(panel, wx.NewId(), u"閉じる")
         # ボタンの位置を設定         # ボタンの位置を設定
行 145: 行 322:
         self.Bind(wx.EVT_BUTTON, self.btnClose_Click, btnClose)         self.Bind(wx.EVT_BUTTON, self.btnClose_Click, btnClose)
  
-    # [閉じる]ボタンクリック時+    # [閉じる] ボタンクリック時
     def btnClose_Click(self, event):     def btnClose_Click(self, event):
         # 閉じる         # 閉じる
         self.Close(True)         self.Close(True)
  
-# PyWxHelloAppクラス(wxAppから派生)+# PyWxHelloApp クラス(wxApp から派生)
 class PyWxHelloApp(wx.App): class PyWxHelloApp(wx.App):
     def OnInit(self):     def OnInit(self):
-        # PyWxHelloFrameクラスを生成(タイトル、サイズを指定)+        # PyWxHelloFrame クラスを生成(タイトル、サイズを指定)
         mainFrame = PyWxHelloFrame(None, -1, "Hello wxPython!!", size=(200, 100))         mainFrame = PyWxHelloFrame(None, -1, "Hello wxPython!!", size=(200, 100))
         # トップウインドウとして設定         # トップウインドウとして設定
行 164: 行 341:
 # メイン処理 # メイン処理
 def main(): def main():
-    # PyWxHelloAppクラスを生成+    # PyWxHelloApp クラスを生成
     app = PyWxHelloApp(False)     app = PyWxHelloApp(False)
     # メインループを開始     # メインループを開始
行 173: 行 350:
     main()     main()
 </code> </code>
 +</WRAP>
 +
 +<WRAP prewrap 100% #source_code>
 +<code python PyWxWebView.py>
 +#!/usr/bin/env python
 +# -*- coding: utf-8 -*-
 +import wx
 +import wx.html2
 +
 +# PyWxWebViewDialog クラス(wxDialog から派生)
 +class PyWxWebViewDialog(wx.Dialog):
 +    def __init__(self, *args, **kwds):
 +        wx.Dialog.__init__(self, *args, **kwds)
 +        # BoxSizer 生成
 +        sizer = wx.BoxSizer(wx.VERTICAL)
 +        # WebView 生成
 +        self.browser = wx.html2.WebView.New(self)
 +        # BoxSizer に WebView を追加
 +        sizer.Add(self.browser, 1, wx.EXPAND, 10)
 +        # Dialog に BoxSizer レイアウトを適用
 +        self.SetSizer(sizer)
 +        # Dialog サイズを設定
 +        self.SetSize((1024, 700))
 +        # Dialog 最小サイズを設定
 +        self.SetMinSize((600,300))
 +        # Dialog をディスプレイ中央に配置
 +        self.Center()
 +
 +if __name__ == '__main__':
 +    # wxApp クラスを生成
 +    app = wx.App()
 +    # PyWxWebViewDialog クラスを生成
 +    dialog = PyWxWebViewDialog(None, -1)
 +    # WebView の URL を設定
 +    dialog.browser.LoadURL('https://html5test.com/')
 +    # Dialog を表示
 +    dialog.Show()
 +    # メインループを開始
 +    app.MainLoop()
 +</code>
 +</WRAP>
 +
 +===== 技術情報 =====
 +
 +==== WebView ====
 +WebView は [[https://docs.microsoft.com/ja-jp/dotnet/framework/winforms/controls/webbrowser-control-overview|WebBrowser コントロール]] で実装されている。\\
 +[[https://html5test.com/|HTML5test]] 確認すると **Internet Explorer 11.0** 相当であることがわかる。\\
 +<WRAP prewrap 100% #source_code>
 +<code cpp wxWidgets\src\msw\webview_ie.cpp>
 +bool wxWebViewIE::Create(wxWindow* parent,
 +           wxWindowID id,
 +           const wxString& url,
 +           const wxPoint& pos,
 +           const wxSize& size,
 +           long style,
 +           const wxString& name)
 +{
 +    if (!wxControl::Create(parent, id, pos, size, style,
 +                           wxDefaultValidator, name))
 +    {
 +        return false;
 +    }
 +
 +    m_webBrowser = NULL;
 +    m_isBusy = false;
 +    m_historyLoadingFromList = false;
 +    m_historyEnabled = true;
 +    m_historyPosition = -1;
 +    m_zoomType = wxWEBVIEW_ZOOM_TYPE_TEXT;
 +    FindClear();
 +
 +    if (::CoCreateInstance(CLSID_WebBrowser, NULL,
 +                           CLSCTX_INPROC_SERVER, // CLSCTX_INPROC,
 +                           IID_IWebBrowser2 , (void**)&m_webBrowser) != 0)
 +    {
 +        wxLogError("Failed to initialize IE, CoCreateInstance returned an error");
 +        return false;
 +    }
 +
 +    m_ie.SetDispatchPtr(m_webBrowser); // wxAutomationObject will release itself
 +
 +    m_webBrowser->put_RegisterAsBrowser(VARIANT_TRUE);
 +    m_webBrowser->put_RegisterAsDropTarget(VARIANT_TRUE);
 +
 +    m_uiHandler = new DocHostUIHandler(this);
 +
 +    m_container = new wxIEContainer(this, IID_IWebBrowser2, m_webBrowser, m_uiHandler);
 +
 +    EnableControlFeature(21 /* FEATURE_DISABLE_NAVIGATION_SOUNDS */);
 +
 +    LoadURL(url);
 +    return true;
 +}
 +</code>
 +</WRAP>
 +
 +===== 参考文献 =====
 +[[https://wiki.gnuradio.org/index.php/WxPythonCygwin|WxPythonCygwin - GNU Radio]]\\
 +[[http://eternalwindows.jp/browser/webbrowser/webbrowser03.html|ホストの実装]]\\
 +[[https://www.atmarkit.co.jp/ait/articles/1807/04/news017.html|WPFやWindowsフォームでEdgeのWebViewを使うには?[Windows 10 1803以降]:.NET TIPS - @IT]]\\
 +[[https://github.com/windows-toolkit/WindowsCommunityToolkit|windows-toolkit/WindowsCommunityToolkit: The Windows Community Toolkit is a collection of helper functions, custom controls, and app services. It simplifies and demonstrates common developer tasks building UWP apps for Windows 10. The toolkit is part of the .NET Foundation.]]\\
 +[[https://www.nuget.org/packages/Microsoft.Web.WebView2|NuGet Gallery | Microsoft.Web.WebView2 0.9.430]]\\
 +[[https://wiki.python.org/moin/WindowsCompilers#Which_Microsoft_Visual_C.2B-.2B-_compiler_to_use_with_a_specific_Python_version_.3F|WindowsCompilers - Python Wiki]]\\
  
  • python/wxpython.txt
  • 最終更新: 2021/06/12 12:32
  • by ともやん