r0x0r / pywebview

Build GUI for your Python program with JavaScript, HTML, and CSS
https://pywebview.flowrl.com
BSD 3-Clause "New" or "Revised" License
4.62k stars 537 forks source link

Using function of pywebview is strange. #550

Closed ryan3216 closed 4 years ago

ryan3216 commented 4 years ago

Specification

Hi sir, I feel that Using function of pywebview is strange. I just want to call a function of pywebview sometimes, not on the beginning. Can you help me?

The demo code as follow:

import webview import time def save_file_dialog(window): time.sleep(5) result = window.create_file_dialog(webview.SAVE_DIALOG, directory='/', save_filename='test.file') print(result) if name == 'main': window = webview.create_window('Save file dialog', 'https://pywebview.flowrl.com/hello') webview.start() save_file_dialog(window)

r0x0r commented 4 years ago

https://pywebview.flowrl.com/examples/save_file_dialog.html

ryan3216 commented 4 years ago

You know the offical demo must use webview.start() to call create_file_dialog(), Can I call create_file_dialog() independent;

r0x0r commented 4 years ago

No.