question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Programmatically does not close PyWebview running GTK

See original GitHub issue

Specification

  • pywebview version: 3.4
  • platform / version: Ubuntu 20LTS and OSX Catalina 10.15.7

Description

I have a shutdown button on the application. Previously running QT the following would work for shutdown:

def shutdown():
    utils.kill_other_processes()
    time.sleep(0.5)
    os._exit(0)

Since switching to GTK this procedure no longer works. I tried to destroy as follows:

def shutdown():
    from app import window
    window.destroy()
    utils.kill_other_processes()
    time.sleep(0.5)

It raises the following warning:

PyObjC: Exception during dealloc of proxy: Completion handler passed to -[BrowserDelegate webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler:] was not called

How would I call this delegate method with the API or is there something wrong with my procedure?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
aug2uagcommented, Feb 2, 2021

the examples file destroys the window-- on mine, window is destroyed with qt no problem, gtk raises the pyObjC message

the examples creates a hang on same machine that can’t close gtk though, program doesn’t end with SIGINT

% python deswindow.py 
Destroying window..
Destroyed!
^C^C

^C^C^C




0reactions
PlumpMathcommented, Dec 4, 2021

Me too… I can’t close the window. MacOS monterey intel How can I get back to the terminal console?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Programmatically does not close PyWebview running ...
Specification. pywebview version: 3.4; platform / version: Ubuntu 20LTS and OSX Catalina 10.15.7. Description. I have a shutdown button on the application.
Read more >
How to Close a Gtk# Window Programmatically?
You are correct, the delete event is only fired when the window manager tries to close the window (i.e. the user clicks on...
Read more >
Changelog - pywebview - flowrl
Fix [GTK] Implement fall-through to QT, when GTK is present, but not GTK.WebKit. # 1.6. Released 29/03/2017. New [All] Quit confirmation dialog ...
Read more >
PyInstaller Documentation - Read the Docs
PyInstaller runs in Windows 8 and newer. It can create graphical windowed apps (apps that do not need a command window). 2.1.2 macOS....
Read more >
[FAQ] "Best" GUI toolkit for python - Google Groups
However, I know highly skilled people who prefer to use Qt Designer, so it is no big deal either way. > > Gtk/PyGObject/PyGI...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found