webui-dev / nim-webui

Use any web browser as GUI, with Nim in the backend and HTML5 in the frontend.
https://webui.me
MIT License
130 stars 9 forks source link

whats is wrong #30

Closed roberto170 closed 4 months ago

roberto170 commented 4 months ago

bind event not working

import webui

const ig = """
    <!DOCTYPE html>
    <html>
     <body>
        <div>hello</div>
        <button id="Bt1">ClickMe</button>
    </body>
    </html>
"""

proc main()=
    let window = newWindow()
    window.bind("Bt1") do (e : Event) : webui.exit()
    window.show(ig)
    wait()

main()
roberto170 commented 4 months ago

examples are working

neroist commented 4 months ago

You need to add <script src="webui.js"></script> into your html.