Files
pywebview/examples/destroy_window.py
Roman c5ff4e1362 Add test suite (#108)
* 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
2017-04-27 16:08:51 +03:00

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")