Phoenix icon indicating copy to clipboard operation
Phoenix copied to clipboard

Calling a webview from pywebview is breaking a wxpython GUI

Open Chen-Michael opened this issue 6 months ago • 4 comments

Operating system: windows 10 wxPython version & source: wxPython>=4.0 Python version & source: 3.9

Description of the problem:

import wx
import wx.html2
import webview

class MyFrame(wx.Frame):
    def __init__(self, *args, **kwds):
        super(MyFrame, self).__init__(*args, **kwds)
        # Create a button
        self.button = wx.Button(self, label="Open WebView")
        self.button.Bind(wx.EVT_BUTTON, self.on_button_click)

    def on_button_click(self, event):
        # This function is called when the button is clicked
        # Create and show the WebView dialog
        auth_url = "https://google.com"
        window = webview.create_window("Access example", auth_url)
        webview.start()

if __name__ == "__main__":
    app = wx.App()
    frame = MyFrame(None)
    frame.Show()
    app.MainLoop()

Chen-Michael avatar Aug 15 '24 04:08 Chen-Michael