Files
pywebview/examples/destroy_window.py
2016-02-12 10:11:13 +02:00

23 lines
488 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()
if __name__ == '__main__':
t = threading.Thread(target=destroy)
t.start()
webview.create_window("Simple browser", "http://www.google.com")
print("Window is destroyed")