Git Product home page Git Product logo

Comments (5)

r0x0r avatar r0x0r commented on September 21, 2024

it is create_confirmation_dialog

from pywebview.

divadsn avatar divadsn commented on September 21, 2024

Yes but that one creates as the name already tells an Yes/No dialog, I am searching for a method to have an alert/message box with an icon (warning/info/error) and an OK button. alert() in JS shows the built-in error which doesn't look good:

image

from pywebview.

r0x0r avatar r0x0r commented on September 21, 2024

There is a custom message box implementation that overwrites window.alert, but it is not enabled for EdgeChromium. I will look into this.

from pywebview.

yllhwa avatar yllhwa commented on September 21, 2024

If you only plan to run on Windows, simply use win32 api like this.

import webview
import ctypes


def my_alert(title, text, flags=0x00001030):
    ctypes.windll.user32.MessageBoxW(None, text, title, flags)


window = webview.create_window("Hello world", "https://pywebview.flowrl.com/hello")
window.expose(my_alert)
webview.start(debug=True)

# js: pywebview.api.my_alert("Error", "error while loading")

image

from pywebview.

r0x0r avatar r0x0r commented on September 21, 2024

I pushed a fix to master

from pywebview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.