mirror of
https://github.com/allankoechke/pywebview.git
synced 2026-12-02 01:33:02 +00:00
* Add preliminary tests * Tests experimentations * Cosmetic changes * Add preliminary tests * Tests experimentations * Cosmetic changes * Make tests work on GTK/QT * Fix confirm_quit on QT * Add possibility to use env variables in config * Add destroy event on event close in GTK * Add queue to test_url_load * Refine OSX tests
24 lines
512 B
Python
24 lines
512 B
Python
import webview
|
|
import threading
|
|
|
|
"""
|
|
This example demonstrates how a webview window is created and destroyed programmatically after 5 seconds
|
|
"""
|
|
#import os
|
|
#os.environ["USE_GTK"] = "true"
|
|
|
|
def destroy():
|
|
import time
|
|
time.sleep(5)
|
|
print("Destroying window..")
|
|
webview.destroy_window()
|
|
print("Destroyed!")
|
|
|
|
|
|
if __name__ == '__main__':
|
|
t = threading.Thread(target=destroy)
|
|
t.start()
|
|
webview.create_window("Simple browser", "http://www.google.com")
|
|
print("Window is destroyed")
|
|
|